mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-09 05:38:58 +00:00
cog: remove // comments
This commit is contained in:
parent
314e2dabd5
commit
bc25896579
10 changed files with 19 additions and 60 deletions
|
@ -84,12 +84,7 @@ cog_frame_new_and_alloc_extended (CogMemoryDomain * domain,
|
||||||
}
|
}
|
||||||
frame->components[0].length = frame->components[0].stride * height;
|
frame->components[0].length = frame->components[0].stride * height;
|
||||||
|
|
||||||
if (domain) {
|
frame->regions[0] = g_malloc (frame->components[0].length);
|
||||||
//frame->regions[0] = cog_memory_domain_alloc (domain,
|
|
||||||
// frame->components[0].length);
|
|
||||||
} else {
|
|
||||||
frame->regions[0] = g_malloc (frame->components[0].length);
|
|
||||||
}
|
|
||||||
|
|
||||||
frame->components[0].data = frame->regions[0];
|
frame->components[0].data = frame->regions[0];
|
||||||
frame->components[0].v_shift = 0;
|
frame->components[0].v_shift = 0;
|
||||||
|
@ -151,14 +146,8 @@ cog_frame_new_and_alloc_extended (CogMemoryDomain * domain,
|
||||||
frame->components[2].v_shift = v_shift;
|
frame->components[2].v_shift = v_shift;
|
||||||
frame->components[2].h_shift = h_shift;
|
frame->components[2].h_shift = h_shift;
|
||||||
|
|
||||||
if (domain) {
|
frame->regions[0] = malloc (frame->components[0].length +
|
||||||
//frame->regions[0] = cog_memory_domain_alloc (domain,
|
frame->components[1].length + frame->components[2].length);
|
||||||
// frame->components[0].length +
|
|
||||||
// frame->components[1].length + frame->components[2].length);
|
|
||||||
} else {
|
|
||||||
frame->regions[0] = malloc (frame->components[0].length +
|
|
||||||
frame->components[1].length + frame->components[2].length);
|
|
||||||
}
|
|
||||||
|
|
||||||
frame->components[0].data = COG_OFFSET (frame->regions[0],
|
frame->components[0].data = COG_OFFSET (frame->regions[0],
|
||||||
frame->components[0].stride * extension + bytes_pp * extension);
|
frame->components[0].stride * extension + bytes_pp * extension);
|
||||||
|
@ -792,11 +781,7 @@ cog_frame_unref (CogFrame * frame)
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (frame->regions[i]) {
|
if (frame->regions[i]) {
|
||||||
if (frame->domain) {
|
g_free (frame->regions[i]);
|
||||||
//cog_memory_domain_memfree(frame->domain, frame->regions[i]);
|
|
||||||
} else {
|
|
||||||
free (frame->regions[i]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -362,8 +362,6 @@ static void
|
||||||
cog_virt_frame_render_downsample_vert_halfsite_2tap (CogFrame * frame,
|
cog_virt_frame_render_downsample_vert_halfsite_2tap (CogFrame * frame,
|
||||||
void *_dest, int component, int i)
|
void *_dest, int component, int i)
|
||||||
{
|
{
|
||||||
//static OrcProgram *p = NULL;
|
|
||||||
//OrcExecutor _ex, *ex = &_ex;
|
|
||||||
uint8_t *dest = _dest;
|
uint8_t *dest = _dest;
|
||||||
uint8_t *src1;
|
uint8_t *src1;
|
||||||
uint8_t *src2;
|
uint8_t *src2;
|
||||||
|
@ -383,8 +381,6 @@ static void
|
||||||
cog_virt_frame_render_downsample_vert_halfsite_4tap (CogFrame * frame,
|
cog_virt_frame_render_downsample_vert_halfsite_4tap (CogFrame * frame,
|
||||||
void *_dest, int component, int i)
|
void *_dest, int component, int i)
|
||||||
{
|
{
|
||||||
//static OrcProgram *p = NULL;
|
|
||||||
//OrcExecutor _ex, *ex = &_ex;
|
|
||||||
uint8_t *dest = _dest;
|
uint8_t *dest = _dest;
|
||||||
uint8_t *src1;
|
uint8_t *src1;
|
||||||
uint8_t *src2;
|
uint8_t *src2;
|
||||||
|
@ -461,7 +457,6 @@ cog_virt_frame_render_downsample_vert_halfsite (CogFrame * frame,
|
||||||
for (j = 0; j < frame->components[component].width; j++) {
|
for (j = 0; j < frame->components[component].width; j++) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
const int taps10[10] = { 1, -2, -5, 9, 29, 29, 9, -5, -2, 1 };
|
const int taps10[10] = { 1, -2, -5, 9, 29, 29, 9, -5, -2, 1 };
|
||||||
//const int taps10[10] = { -1, 1, 6, 11, 15, 15, 11, 6, 1, -1 };
|
|
||||||
for (k = 0; k < 10; k++) {
|
for (k = 0; k < 10; k++) {
|
||||||
x += taps10[k] * src[k][j];
|
x += taps10[k] * src[k][j];
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,11 +37,15 @@ GType gst_decimate_get_type (void);
|
||||||
GType gst_motion_detect_get_type (void);
|
GType gst_motion_detect_get_type (void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY (cog_debug);
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
plugin_init (GstPlugin * plugin)
|
plugin_init (GstPlugin * plugin)
|
||||||
{
|
{
|
||||||
orc_init ();
|
orc_init ();
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_INIT (cog_debug, "cog", 0, "Cog");
|
||||||
|
|
||||||
gst_element_register (plugin, "cogdownsample", GST_RANK_NONE,
|
gst_element_register (plugin, "cogdownsample", GST_RANK_NONE,
|
||||||
gst_cogdownsample_get_type ());
|
gst_cogdownsample_get_type ());
|
||||||
gst_element_register (plugin, "cogcolorspace", GST_RANK_NONE,
|
gst_element_register (plugin, "cogcolorspace", GST_RANK_NONE,
|
||||||
|
|
|
@ -154,7 +154,6 @@ gst_cogcolorspace_base_init (gpointer g_class)
|
||||||
"YCbCr format conversion",
|
"YCbCr format conversion",
|
||||||
"David Schleef <ds@schleef.org>");
|
"David Schleef <ds@schleef.org>");
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
//GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (g_class);
|
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_cogcolorspace_src_template));
|
gst_static_pad_template_get (&gst_cogcolorspace_src_template));
|
||||||
|
@ -195,8 +194,6 @@ gst_cogcolorspace_class_init (gpointer g_class, gpointer class_data)
|
||||||
static void
|
static void
|
||||||
gst_cogcolorspace_init (GTypeInstance * instance, gpointer g_class)
|
gst_cogcolorspace_init (GTypeInstance * instance, gpointer g_class)
|
||||||
{
|
{
|
||||||
//GstCogcolorspace *compress = GST_COGCOLORSPACE (instance);
|
|
||||||
//GstBaseTransform *btrans = GST_BASE_TRANSFORM (instance);
|
|
||||||
|
|
||||||
GST_DEBUG ("gst_cogcolorspace_init");
|
GST_DEBUG ("gst_cogcolorspace_init");
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,6 @@ struct _GstCogdownsample
|
||||||
{
|
{
|
||||||
GstBaseTransform base_transform;
|
GstBaseTransform base_transform;
|
||||||
|
|
||||||
//CogVideoFormat format;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _GstCogdownsampleClass
|
struct _GstCogdownsampleClass
|
||||||
|
@ -146,7 +145,6 @@ gst_cogdownsample_base_init (gpointer g_class)
|
||||||
"Decreases size of video by a factor of 2",
|
"Decreases size of video by a factor of 2",
|
||||||
"David Schleef <ds@schleef.org>");
|
"David Schleef <ds@schleef.org>");
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
//GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (g_class);
|
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_cogdownsample_src_template));
|
gst_static_pad_template_get (&gst_cogdownsample_src_template));
|
||||||
|
@ -187,8 +185,6 @@ gst_cogdownsample_class_init (gpointer g_class, gpointer class_data)
|
||||||
static void
|
static void
|
||||||
gst_cogdownsample_init (GTypeInstance * instance, gpointer g_class)
|
gst_cogdownsample_init (GTypeInstance * instance, gpointer g_class)
|
||||||
{
|
{
|
||||||
//GstCogdownsample *compress = GST_COGDOWNSAMPLE (instance);
|
|
||||||
//GstBaseTransform *btrans = GST_BASE_TRANSFORM (instance);
|
|
||||||
|
|
||||||
GST_DEBUG ("gst_cogdownsample_init");
|
GST_DEBUG ("gst_cogdownsample_init");
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,7 +150,6 @@ gst_cog_filter_base_init (gpointer g_class)
|
||||||
"Applies a cog pre-filter to video",
|
"Applies a cog pre-filter to video",
|
||||||
"David Schleef <ds@schleef.org>");
|
"David Schleef <ds@schleef.org>");
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
//GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (g_class);
|
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_cog_filter_src_template));
|
gst_static_pad_template_get (&gst_cog_filter_src_template));
|
||||||
|
@ -187,8 +186,6 @@ gst_cog_filter_class_init (gpointer g_class, gpointer class_data)
|
||||||
static void
|
static void
|
||||||
gst_cog_filter_init (GTypeInstance * instance, gpointer g_class)
|
gst_cog_filter_init (GTypeInstance * instance, gpointer g_class)
|
||||||
{
|
{
|
||||||
//GstCogFilter *compress = GST_COG_FILTER (instance);
|
|
||||||
//GstBaseTransform *btrans = GST_BASE_TRANSFORM (instance);
|
|
||||||
|
|
||||||
GST_DEBUG ("gst_cog_filter_init");
|
GST_DEBUG ("gst_cog_filter_init");
|
||||||
}
|
}
|
||||||
|
@ -253,7 +250,8 @@ gst_cog_filter_transform_ip (GstBaseTransform * base_transform, GstBuffer * buf)
|
||||||
"height", &height);
|
"height", &height);
|
||||||
|
|
||||||
frame = cog_frame_new_from_data_I420 (GST_BUFFER_DATA (buf), width, height);
|
frame = cog_frame_new_from_data_I420 (GST_BUFFER_DATA (buf), width, height);
|
||||||
//cog_frame_filter_lowpass2 (frame, 5.0);
|
|
||||||
|
/* FIXME do something here */
|
||||||
|
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,6 @@ static GstFlowReturn gst_mse_chain_test (GstPad * pad, GstBuffer * buffer);
|
||||||
static GstFlowReturn gst_mse_chain_ref (GstPad * pad, GstBuffer * buffer);
|
static GstFlowReturn gst_mse_chain_ref (GstPad * pad, GstBuffer * buffer);
|
||||||
static gboolean gst_mse_sink_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_mse_sink_event (GstPad * pad, GstEvent * event);
|
||||||
static void gst_mse_reset (GstMSE * filter);
|
static void gst_mse_reset (GstMSE * filter);
|
||||||
//static GstPadLinkReturn gst_mse_link_src (GstPad *pad, GstPad *peer);
|
|
||||||
static GstCaps *gst_mse_getcaps (GstPad * pad);
|
static GstCaps *gst_mse_getcaps (GstPad * pad);
|
||||||
static gboolean gst_mse_set_caps (GstPad * pad, GstCaps * outcaps);
|
static gboolean gst_mse_set_caps (GstPad * pad, GstCaps * outcaps);
|
||||||
static void gst_mse_finalize (GObject * object);
|
static void gst_mse_finalize (GObject * object);
|
||||||
|
@ -173,7 +172,6 @@ gst_mse_init (GstMSE * filter, GstMSEClass * klass)
|
||||||
|
|
||||||
filter->srcpad = gst_element_get_static_pad (GST_ELEMENT (filter), "src");
|
filter->srcpad = gst_element_get_static_pad (GST_ELEMENT (filter), "src");
|
||||||
|
|
||||||
//gst_pad_set_link_function (filter->srcpad, gst_mse_link_src);
|
|
||||||
gst_pad_set_getcaps_function (filter->srcpad, gst_mse_getcaps);
|
gst_pad_set_getcaps_function (filter->srcpad, gst_mse_getcaps);
|
||||||
|
|
||||||
filter->sinkpad_ref =
|
filter->sinkpad_ref =
|
||||||
|
@ -271,7 +269,6 @@ static void
|
||||||
gst_mse_set_property (GObject * object, guint prop_id,
|
gst_mse_set_property (GObject * object, guint prop_id,
|
||||||
const GValue * value, GParamSpec * pspec)
|
const GValue * value, GParamSpec * pspec)
|
||||||
{
|
{
|
||||||
//GstMSE *fs = GST_MSE (object);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
//GST_DEBUG_CATEGORY_EXTERN (cog_debug);
|
GST_DEBUG_CATEGORY_EXTERN (cog_debug);
|
||||||
//#define GST_CAT_DEFAULT cog_debug
|
#define GST_CAT_DEFAULT cog_debug
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -141,7 +141,6 @@ gst_colorconvert_base_init (gpointer g_class)
|
||||||
"Template for a video filter",
|
"Template for a video filter",
|
||||||
"David Schleef <ds@schleef.org>");
|
"David Schleef <ds@schleef.org>");
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
//GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (g_class);
|
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_colorconvert_src_template));
|
gst_static_pad_template_get (&gst_colorconvert_src_template));
|
||||||
|
@ -172,8 +171,6 @@ gst_colorconvert_class_init (gpointer g_class, gpointer class_data)
|
||||||
static void
|
static void
|
||||||
gst_colorconvert_init (GTypeInstance * instance, gpointer g_class)
|
gst_colorconvert_init (GTypeInstance * instance, gpointer g_class)
|
||||||
{
|
{
|
||||||
//GstColorconvert *compress = GST_COLORCONVERT (instance);
|
|
||||||
//GstBaseTransform *btrans = GST_BASE_TRANSFORM (instance);
|
|
||||||
|
|
||||||
GST_DEBUG ("gst_colorconvert_init");
|
GST_DEBUG ("gst_colorconvert_init");
|
||||||
}
|
}
|
||||||
|
@ -526,15 +523,16 @@ color_matrix_build_yuv_to_rgb_601 (ColorMatrix * dst)
|
||||||
|
|
||||||
/* colour matrix, YCbCr -> RGB */
|
/* colour matrix, YCbCr -> RGB */
|
||||||
/* Requires Y in [0,1.0], Cb&Cr in [-0.5,0.5] */
|
/* Requires Y in [0,1.0], Cb&Cr in [-0.5,0.5] */
|
||||||
color_matrix_YCbCr_to_RGB (dst, 0.2990, 0.1140); // SD
|
color_matrix_YCbCr_to_RGB (dst, 0.2990, 0.1140); /* SD */
|
||||||
//color_matrix_YCbCr_to_RGB (dst, 0.2126, 0.0722); // HD
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* We are now in RGB space
|
* We are now in RGB space
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if 0
|
||||||
/* scale to output range. */
|
/* scale to output range. */
|
||||||
//color_matrix_scale_components (dst, 255.0, 255.0, 255.0);
|
color_matrix_scale_components (dst, 255.0, 255.0, 255.0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -550,10 +548,9 @@ color_matrix_build_bt709_to_bt601 (ColorMatrix * dst)
|
||||||
|
|
||||||
/* colour matrix, YCbCr -> RGB */
|
/* colour matrix, YCbCr -> RGB */
|
||||||
/* Requires Y in [0,1.0], Cb&Cr in [-0.5,0.5] */
|
/* Requires Y in [0,1.0], Cb&Cr in [-0.5,0.5] */
|
||||||
//color_matrix_YCbCr_to_RGB (dst, 0.2990, 0.1140); // SD
|
color_matrix_YCbCr_to_RGB (dst, 0.2126, 0.0722); /* HD */
|
||||||
color_matrix_YCbCr_to_RGB (dst, 0.2126, 0.0722); // HD
|
|
||||||
|
|
||||||
color_matrix_RGB_to_YCbCr (dst, 0.2990, 0.1140); // SD
|
color_matrix_RGB_to_YCbCr (dst, 0.2990, 0.1140); /* SD */
|
||||||
|
|
||||||
color_matrix_scale_components (dst, 219.0, 224.0, 224.0);
|
color_matrix_scale_components (dst, 219.0, 224.0, 224.0);
|
||||||
|
|
||||||
|
@ -565,11 +562,7 @@ color_matrix_build_rgb_to_yuv_601 (ColorMatrix * dst)
|
||||||
{
|
{
|
||||||
color_matrix_set_identity (dst);
|
color_matrix_set_identity (dst);
|
||||||
|
|
||||||
//color_matrix_scale_components (dst, (1/255.0), (1/255.0), (1/255.0));
|
color_matrix_RGB_to_YCbCr (dst, 0.2990, 0.1140); /* SD */
|
||||||
|
|
||||||
color_matrix_RGB_to_YCbCr (dst, 0.2990, 0.1140); // SD
|
|
||||||
//color_matrix_RGB_to_YCbCr (dst, 0.2126, 0.0722); // HD
|
|
||||||
//color_matrix_RGB_to_YCbCr (dst, 0.212, 0.087); // SMPTE 240M
|
|
||||||
|
|
||||||
color_matrix_scale_components (dst, 219.0, 224.0, 224.0);
|
color_matrix_scale_components (dst, 219.0, 224.0, 224.0);
|
||||||
|
|
||||||
|
|
|
@ -153,7 +153,6 @@ gst_logoinsert_base_init (gpointer g_class)
|
||||||
"Template for a video filter",
|
"Template for a video filter",
|
||||||
"David Schleef <ds@schleef.org>");
|
"David Schleef <ds@schleef.org>");
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
//GstBaseTransformClass *base_transform_class = GST_BASE_TRANSFORM_CLASS (g_class);
|
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&gst_logoinsert_src_template));
|
gst_static_pad_template_get (&gst_logoinsert_src_template));
|
||||||
|
@ -188,8 +187,6 @@ gst_logoinsert_class_init (gpointer g_class, gpointer class_data)
|
||||||
static void
|
static void
|
||||||
gst_logoinsert_init (GTypeInstance * instance, gpointer g_class)
|
gst_logoinsert_init (GTypeInstance * instance, gpointer g_class)
|
||||||
{
|
{
|
||||||
//GstLogoinsert *compress = GST_LOGOINSERT (instance);
|
|
||||||
//GstBaseTransform *btrans = GST_BASE_TRANSFORM (instance);
|
|
||||||
|
|
||||||
GST_DEBUG ("gst_logoinsert_init");
|
GST_DEBUG ("gst_logoinsert_init");
|
||||||
}
|
}
|
||||||
|
@ -409,11 +406,8 @@ cog_frame_new_from_png (void *data, int size)
|
||||||
png_read_image (png_ptr, rows);
|
png_read_image (png_ptr, rows);
|
||||||
g_free (rows);
|
g_free (rows);
|
||||||
|
|
||||||
// PNG_TRANSFORM_STRP_16 | PNG_TRANSFORM_PACKING,
|
|
||||||
|
|
||||||
png_destroy_read_struct (&png_ptr, &info_ptr, png_infopp_NULL);
|
png_destroy_read_struct (&png_ptr, &info_ptr, png_infopp_NULL);
|
||||||
|
|
||||||
|
|
||||||
return frame;
|
return frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue