From 4fd57bbe3fef59592a8664dcc9fa2ab32ae99c69 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Mon, 15 Mar 2004 19:32:27 +0000 Subject: don't mix tabs and spaces Original commit message from CVS: don't mix tabs and spaces --- gst/cdxaparse/gstcdxaparse.c | 12 +- gst/chart/gstchart.c | 49 +- gst/colorspace/gstcolorspace.c | 227 ++--- gst/colorspace/yuv2rgb.c | 200 ++-- gst/deinterlace/gstdeinterlace.c | 85 +- gst/festival/gstfestival.c | 33 +- gst/filter/gstbpwsinc.c | 44 +- gst/filter/gstfilter.c | 2 +- gst/filter/gstiir.c | 14 +- gst/filter/gstlpwsinc.c | 26 +- gst/flx/gstflxdec.c | 185 ++-- gst/mixmatrix/mixmatrix.c | 55 +- gst/modplug/gstmodplug.cc | 124 +-- gst/mpeg1sys/buffer.c | 188 ++-- gst/mpeg1sys/gstmpeg1systemencode.c | 105 +- gst/mpeg1sys/systems.c | 10 +- gst/mpeg1videoparse/gstmp1videoparse.c | 249 ++--- gst/mpeg2sub/gstmpeg2subt.c | 159 +-- gst/mpegaudioparse/gstmpegaudioparse.c | 151 +-- gst/overlay/gstoverlay.c | 41 +- gst/passthrough/gstpassthrough.c | 41 +- gst/playondemand/demo-mp3.c | 6 +- gst/playondemand/gstplayondemand.c | 61 +- gst/qtdemux/qtdemux.c | 739 +++++++------- gst/rtjpeg/RTjpeg.c | 1686 ++++++++++++++++---------------- gst/rtjpeg/gstrtjpeg.c | 4 +- gst/rtjpeg/gstrtjpegdec.c | 5 +- gst/rtjpeg/gstrtjpegenc.c | 5 +- gst/smooth/gstsmooth.c | 37 +- gst/smoothwave/gstsmoothwave.c | 23 +- gst/smpte/barboxwipes.c | 702 ++++++------- gst/smpte/gstsmpte.c | 53 +- gst/smpte/paint.c | 36 +- gst/spectrum/demo-osssrc.c | 2 +- gst/spectrum/fix_fft.c | 70 +- gst/spectrum/gstspectrum.c | 7 +- gst/speed/demo-mp3.c | 4 +- gst/speed/gstspeed.c | 11 +- gst/stereo/gststereo.c | 15 +- gst/switch/gstswitch.c | 74 +- gst/vbidec/gstvbidec.c | 22 +- gst/vbidec/vbidata.c | 706 ++++++------- gst/vbidec/vbiscreen.c | 126 +-- gst/videocrop/gstvideocrop.c | 17 +- gst/videodrop/gstvideodrop.c | 22 +- gst/virtualdub/gstvirtualdub.c | 66 +- gst/virtualdub/gstxsharpen.c | 128 +-- gst/y4m/gsty4mencode.c | 13 +- 48 files changed, 3334 insertions(+), 3306 deletions(-) (limited to 'gst') diff --git a/gst/cdxaparse/gstcdxaparse.c b/gst/cdxaparse/gstcdxaparse.c index 3241db24..595191b7 100644 --- a/gst/cdxaparse/gstcdxaparse.c +++ b/gst/cdxaparse/gstcdxaparse.c @@ -102,9 +102,10 @@ gst_cdxa_parse_get_type (void) 0, (GInstanceInitFunc) gst_cdxa_parse_init, }; + cdxa_parse_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstCDXAParse", - &cdxa_parse_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstCDXAParse", + &cdxa_parse_info, 0); } return cdxa_parse_type; } @@ -202,7 +203,8 @@ typedef struct gchar CDXA_tag[4]; gchar fmt_tag[4]; guint32 fmt_size; -} CDXAParseHeader; +} +CDXAParseHeader; /* A sectors is 2352 bytes long and is composed of: @@ -245,7 +247,7 @@ gst_cdxa_parse_loop (GstElement * element) /* get the data size */ got_bytes = - gst_bytestream_peek_bytes (cdxa_parse->bs, (guint8 **) & buf, 4); + gst_bytestream_peek_bytes (cdxa_parse->bs, (guint8 **) & buf, 4); if (got_bytes < 4) return; cdxa_parse->data_size = GUINT32_FROM_LE (*((guint32 *) buf)); @@ -315,7 +317,7 @@ plugin_init (GstPlugin * plugin) return FALSE; if (!gst_element_register (plugin, "cdxaparse", GST_RANK_NONE, - GST_TYPE_CDXA_PARSE)) + GST_TYPE_CDXA_PARSE)) return FALSE; return TRUE; diff --git a/gst/chart/gstchart.c b/gst/chart/gstchart.c index 21832795..6b5eb456 100644 --- a/gst/chart/gstchart.c +++ b/gst/chart/gstchart.c @@ -50,9 +50,9 @@ struct _GstChart gint height; gint samplerate; - gdouble framerate; /* desired frame rate */ - gint samples_between_frames; /* number of samples between start of successive frames */ - gint samples_since_last_frame; /* number of samples between start of successive frames */ + gdouble framerate; /* desired frame rate */ + gint samples_between_frames; /* number of samples between start of successive frames */ + gint samples_since_last_frame; /* number of samples between start of successive frames */ }; struct _GstChartClass @@ -94,11 +94,11 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " - "rate = (int) [ 8000, 96000 ], " "channels = (int) 1") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " + "rate = (int) [ 8000, 96000 ], " "channels = (int) 1") ); static void gst_chart_base_init (gpointer g_class); @@ -136,6 +136,7 @@ gst_chart_get_type (void) 0, (GInstanceInitFunc) gst_chart_init, }; + type = g_type_register_static (GST_TYPE_ELEMENT, "GstChart", &info, 0); } return type; @@ -194,8 +195,8 @@ gst_chart_init (GstChart * chart) chart->height = 128; chart->samplerate = -1; - chart->framerate = 25; /* desired frame rate */ - chart->samples_between_frames = 0; /* number of samples between start of successive frames */ + chart->framerate = 25; /* desired frame rate */ + chart->samples_between_frames = 0; /* number of samples between start of successive frames */ chart->samples_since_last_frame = 0; } @@ -264,29 +265,29 @@ draw_chart_16bpp (guchar * output, gint width, gint height, if (h1 < height / 2) { while (pos < colstart + h1 * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } while (pos < colstart + height / 2 * width) { - *pos = 0x07e0; - pos += width; + *pos = 0x07e0; + pos += width; } while (pos < colstart + height * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } } else { while (pos < colstart + height / 2 * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } while (pos < colstart + h1 * width) { - *pos = 0x07e0; - pos += width; + *pos = 0x07e0; + pos += width; } while (pos < colstart + height * width) { - *pos = 0x0000; - pos += width; + *pos = 0x0000; + pos += width; } } } @@ -333,12 +334,12 @@ gst_chart_chain (GstPad * pad, GstData * _data) GST_BUFFER_SIZE (bufout) = sizeout; GST_BUFFER_DATA (bufout) = dataout; GST_DEBUG ("CHART: made new buffer: size %d, width %d, height %d", - sizeout, chart->width, chart->height); + sizeout, chart->width, chart->height); /* take data and draw to new buffer */ /* FIXME: call different routines for different properties */ draw_chart_16bpp (dataout, chart->width, chart->height, (gint16 *) datain, - samples_in); + samples_in); gst_buffer_unref (bufin); diff --git a/gst/colorspace/gstcolorspace.c b/gst/colorspace/gstcolorspace.c index 8ec6fe8a..fb7f8db0 100644 --- a/gst/colorspace/gstcolorspace.c +++ b/gst/colorspace/gstcolorspace.c @@ -62,7 +62,7 @@ static GstStaticPadTemplate gst_colorspace_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_xRGB "; " - GST_VIDEO_CAPS_BGRx "; " GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_RGB_16) + GST_VIDEO_CAPS_BGRx "; " GST_VIDEO_CAPS_RGB "; " GST_VIDEO_CAPS_RGB_16) ); /* Stereo signals and args */ @@ -132,125 +132,125 @@ colorspace_setup_converter (GstColorspace * space, GstCaps * from_caps, gst_structure_get_int (from_struct, "bpp", &from_bpp); switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): #ifdef HAVE_HERMES - { - gint to_bpp; - - gst_structure_get_int (to_struct, "bpp", &to_bpp); - - gst_structure_get_int (from_struct, "red_mask", &space->source.r); - gst_structure_get_int (from_struct, "green_mask", &space->source.g); - gst_structure_get_int (from_struct, "blue_mask", &space->source.b); - space->source.a = 0; - space->srcbpp = space->source.bits = from_bpp; - space->source.indexed = 0; - space->source.has_colorkey = 0; - - GST_INFO ("source red mask %08x", space->source.r); - GST_INFO ("source green mask %08x", space->source.g); - GST_INFO ("source blue mask %08x", space->source.b); - GST_INFO ("source bpp %08x", space->srcbpp); - - gst_structure_get_int (to_struct, "red_mask", &space->dest.r); - gst_structure_get_int (to_struct, "green_mask", &space->dest.g); - gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); - space->dest.a = 0; - space->destbpp = space->dest.bits = to_bpp; - space->dest.indexed = 0; - space->dest.has_colorkey = 0; - - GST_INFO ("dest red mask %08x", space->dest.r); - GST_INFO ("dest green mask %08x", space->dest.g); - GST_INFO ("dest blue mask %08x", space->dest.b); - GST_INFO ("dest bpp %08x", space->destbpp); - - if (!Hermes_ConverterRequest (space->h_handle, &space->source, - &space->dest)) { - g_warning ("Hermes: could not get converter\n"); - return FALSE; - } - GST_INFO ("converter set up"); - space->type = GST_COLORSPACE_HERMES; - return TRUE; - } + { + gint to_bpp; + + gst_structure_get_int (to_struct, "bpp", &to_bpp); + + gst_structure_get_int (from_struct, "red_mask", &space->source.r); + gst_structure_get_int (from_struct, "green_mask", &space->source.g); + gst_structure_get_int (from_struct, "blue_mask", &space->source.b); + space->source.a = 0; + space->srcbpp = space->source.bits = from_bpp; + space->source.indexed = 0; + space->source.has_colorkey = 0; + + GST_INFO ("source red mask %08x", space->source.r); + GST_INFO ("source green mask %08x", space->source.g); + GST_INFO ("source blue mask %08x", space->source.b); + GST_INFO ("source bpp %08x", space->srcbpp); + + gst_structure_get_int (to_struct, "red_mask", &space->dest.r); + gst_structure_get_int (to_struct, "green_mask", &space->dest.g); + gst_structure_get_int (to_struct, "blue_mask", &space->dest.b); + space->dest.a = 0; + space->destbpp = space->dest.bits = to_bpp; + space->dest.indexed = 0; + space->dest.has_colorkey = 0; + + GST_INFO ("dest red mask %08x", space->dest.r); + GST_INFO ("dest green mask %08x", space->dest.g); + GST_INFO ("dest blue mask %08x", space->dest.b); + GST_INFO ("dest bpp %08x", space->destbpp); + + if (!Hermes_ConverterRequest (space->h_handle, &space->source, + &space->dest)) { + g_warning ("Hermes: could not get converter\n"); + return FALSE; + } + GST_INFO ("converter set up"); + space->type = GST_COLORSPACE_HERMES; + return TRUE; + } #else - g_warning ("colorspace: compiled without hermes!"); - return FALSE; + g_warning ("colorspace: compiled without hermes!"); + return FALSE; #endif - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - if (from_bpp == 32) { - space->type = GST_COLORSPACE_RGB32_YV12; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - if (from_bpp == 32) { - space->type = GST_COLORSPACE_RGB32_I420; - space->destbpp = 12; - return TRUE; - } - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", - from_bpp); - return FALSE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + if (from_bpp == 32) { + space->type = GST_COLORSPACE_RGB32_YV12; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + if (from_bpp == 32) { + space->type = GST_COLORSPACE_RGB32_I420; + space->destbpp = 12; + return TRUE; + } + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + GST_INFO ("colorspace: RGB to YUV with bpp %d not implemented!!", + from_bpp); + return FALSE; } break; } case GST_MAKE_FOURCC ('I', '4', '2', '0'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUV to RGB"); - - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUV to RGB"); + + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; } break; case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_COLORSPACE_YUY2_I420; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): - space->type = GST_COLORSPACE_NONE; - space->destbpp = 16; - return TRUE; - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); - return FALSE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_COLORSPACE_YUY2_I420; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'U', 'Y', '2'): + space->type = GST_COLORSPACE_NONE; + space->destbpp = 16; + return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YUY2 to RGB not implemented!!"); + return FALSE; } break; case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): switch (to_space) { - case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): - GST_INFO ("colorspace: YV12 to RGB"); - - gst_structure_get_int (to_struct, "bpp", &space->destbpp); - space->converter = - gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); - space->type = GST_COLORSPACE_YUV_RGB; - return TRUE; - case GST_MAKE_FOURCC ('I', '4', '2', '0'): - space->type = GST_COLORSPACE_420_SWAP; - space->destbpp = 12; - return TRUE; - case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): - space->type = GST_COLORSPACE_NONE; - space->destbpp = 12; - return TRUE; + case GST_MAKE_FOURCC ('R', 'G', 'B', ' '): + GST_INFO ("colorspace: YV12 to RGB"); + + gst_structure_get_int (to_struct, "bpp", &space->destbpp); + space->converter = + gst_colorspace_yuv2rgb_get_converter (from_caps, to_caps); + space->type = GST_COLORSPACE_YUV_RGB; + return TRUE; + case GST_MAKE_FOURCC ('I', '4', '2', '0'): + space->type = GST_COLORSPACE_420_SWAP; + space->destbpp = 12; + return TRUE; + case GST_MAKE_FOURCC ('Y', 'V', '1', '2'): + space->type = GST_COLORSPACE_NONE; + space->destbpp = 12; + return TRUE; } break; } @@ -317,7 +317,7 @@ gst_colorspace_get_format (const GstCaps * caps) GstCaps *fcaps; fcaps = - gst_caps_copy (gst_static_caps_get (&gst_colorspace_formats[i].caps)); + gst_caps_copy (gst_static_caps_get (&gst_colorspace_formats[i].caps)); icaps = gst_caps_intersect (caps, fcaps); if (!gst_caps_is_empty (icaps)) { @@ -417,8 +417,8 @@ gst_colorspace_link (GstPad * pad, const GstCaps * caps) othercaps = gst_caps_copy (gst_pad_get_negotiated_caps (otherpad)); gst_caps_set_simple (othercaps, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); + "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, "framerate", G_TYPE_DOUBLE, fps, NULL); link_ret = gst_pad_try_set_caps (otherpad, othercaps); if (link_ret != GST_PAD_LINK_OK) { @@ -434,15 +434,15 @@ gst_colorspace_link (GstPad * pad, const GstCaps * caps) if (gst_pad_is_negotiated (otherpad)) { space->converter_index = - gst_colorspace_get_converter (space->sink_format_index, - space->src_format_index); + gst_colorspace_get_converter (space->sink_format_index, + space->src_format_index); g_print ("using index %d\n", space->converter_index); space->sink_size = gst_colorspace_format_get_size (space->sink_format_index, - width, height); + width, height); space->src_size = gst_colorspace_format_get_size (space->src_format_index, - width, height); + width, height); space->width = width; space->height = height; space->fps = fps; @@ -474,9 +474,10 @@ gst_colorspace_get_type (void) 0, (GInstanceInitFunc) gst_colorspace_init, }; + colorspace_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstColorspace", - &colorspace_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstColorspace", + &colorspace_info, 0); } return colorspace_type; } @@ -621,7 +622,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "colorspace", GST_RANK_PRIMARY, - GST_TYPE_COLORSPACE)) + GST_TYPE_COLORSPACE)) return FALSE; return TRUE; diff --git a/gst/colorspace/yuv2rgb.c b/gst/colorspace/yuv2rgb.c index 37eaa628..290f07bc 100644 --- a/gst/colorspace/yuv2rgb.c +++ b/gst/colorspace/yuv2rgb.c @@ -231,9 +231,9 @@ gst_colorspace_I420_to_bgr32_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ - src + size, /* cr component */ - src + size + (size >> 2), /* cb component */ + gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ + src + size, /* cr component */ + src + size + (size >> 2), /* cb component */ dest, space->height, space->width); } @@ -248,9 +248,9 @@ gst_colorspace_I420_to_bgr16_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ - src + size, /* cr component */ - src + size + (size >> 2), /* cb component */ + gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ + src + size, /* cr component */ + src + size + (size >> 2), /* cb component */ dest, space->height, space->width); GST_DEBUG ("gst_colorspace_I420_to_bgr16_mmx done"); @@ -266,9 +266,9 @@ gst_colorspace_YV12_to_bgr32_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ - src + size + (size >> 2), /* cb component */ - src + size, /* cr component */ + gst_colorspace_yuv_to_bgr32_mmx (NULL, src, /* Y component */ + src + size + (size >> 2), /* cb component */ + src + size, /* cr component */ dest, space->height, space->width); } @@ -283,9 +283,9 @@ gst_colorspace_YV12_to_bgr16_mmx (GstColorspace * space, unsigned char *src, size = space->width * space->height; - gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ - src + size + (size >> 2), /* cb component */ - src + size, /* cr component */ + gst_colorspace_yuv_to_bgr16_mmx (NULL, src, /* Y component */ + src + size + (size >> 2), /* cb component */ + src + size, /* cr component */ dest, space->height, space->width); GST_DEBUG ("gst_colorspace_YV12_to_bgr16_mmx done"); @@ -500,7 +500,7 @@ gst_colorspace_yuv_to_rgb32 (GstColorspace * space, dest[x * 4 + 0] = 0; dest[x * 3 + 1] = CLAMP (Y[x] + V_r_tab[V[x / 2]], 0, 255); dest[x * 3 + 2] = - CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); + CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); dest[x * 3 + 3] = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255); } Y += src_rowstride; @@ -527,7 +527,7 @@ gst_colorspace_yuv_to_rgb24 (GstColorspace * space, for (x = 0; x < width; x++) { dest[x * 3 + 0] = CLAMP (Y[x] + V_r_tab[V[x / 2]], 0, 255); dest[x * 3 + 1] = - CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); + CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); dest[x * 3 + 2] = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255); } Y += src_rowstride; @@ -557,7 +557,7 @@ gst_colorspace_yuv_to_rgb16 (GstColorspace * space, g = CLAMP (Y[x] + U_g_tab[U[x / 2]] + V_g_tab[V[x / 2]], 0, 255); b = CLAMP (Y[x] + U_b_tab[U[x / 2]], 0, 255); *(unsigned short *) (dest + x * 2) = - ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); + ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } Y += src_rowstride; dest += dest_rowstride; @@ -569,10 +569,10 @@ gst_colorspace_yuv_to_rgb16 (GstColorspace * space, } #ifdef HAVE_LIBMMX -static mmx_t MMX_80w = (mmx_t) (long long) 0x0080008000800080LL; /*dd 00080 0080h, 000800080h */ +static mmx_t MMX_80w = (mmx_t) (long long) 0x0080008000800080LL; /*dd 00080 0080h, 000800080h */ -static mmx_t MMX_00FFw = (mmx_t) (long long) 0x00ff00ff00ff00ffLL; /*dd 000FF 00FFh, 000FF00FFh */ -static mmx_t MMX_FF00w = (mmx_t) (long long) 0xff00ff00ff00ff00LL; /*dd 000FF 00FFh, 000FF00FFh */ +static mmx_t MMX_00FFw = (mmx_t) (long long) 0x00ff00ff00ff00ffLL; /*dd 000FF 00FFh, 000FF00FFh */ +static mmx_t MMX_FF00w = (mmx_t) (long long) 0xff00ff00ff00ff00LL; /*dd 000FF 00FFh, 000FF00FFh */ static mmx_t MMX32_Vredcoeff = (mmx_t) (long long) 0x0059005900590059LL; static mmx_t MMX32_Ubluecoeff = (mmx_t) (long long) 0x0072007200720072LL; @@ -589,7 +589,7 @@ gst_colorspace_yuv_to_bgr32_mmx (tables, lum, cr, cb, out, rows, cols) int cols, rows; { - guint32 *row1 = (guint32 *) out; /* 32 bit target */ + guint32 *row1 = (guint32 *) out; /* 32 bit target */ int cols4 = cols >> 2; int y, x; @@ -598,108 +598,108 @@ gst_colorspace_yuv_to_bgr32_mmx (tables, lum, cr, cb, out, rows, cols) for (x = cols4; x; x--) { /* create Cr (result in mm1) */ - movd_m2r (*(mmx_t *) cb, mm1); /* 0 0 0 0 v3 v2 v1 v0 */ - pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ - movd_m2r (*(mmx_t *) lum, mm2); /* 0 0 0 0 l3 l2 l1 l0 */ - punpcklbw_r2r (mm7, mm1); /* 0 v3 0 v2 00 v1 00 v0 */ - punpckldq_r2r (mm1, mm1); /* 00 v1 00 v0 00 v1 00 v0 */ - psubw_m2r (MMX_80w, mm1); /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */ + movd_m2r (*(mmx_t *) cb, mm1); /* 0 0 0 0 v3 v2 v1 v0 */ + pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ + movd_m2r (*(mmx_t *) lum, mm2); /* 0 0 0 0 l3 l2 l1 l0 */ + punpcklbw_r2r (mm7, mm1); /* 0 v3 0 v2 00 v1 00 v0 */ + punpckldq_r2r (mm1, mm1); /* 00 v1 00 v0 00 v1 00 v0 */ + psubw_m2r (MMX_80w, mm1); /* mm1-128:r1 r1 r0 r0 r1 r1 r0 r0 */ /* create Cr_g (result in mm0) */ - movq_r2r (mm1, mm0); /* r1 r1 r0 r0 r1 r1 r0 r0 */ - pmullw_m2r (MMX32_Vgrncoeff, mm0); /* red*-46dec=0.7136*64 */ - pmullw_m2r (MMX32_Vredcoeff, mm1); /* red*89dec=1.4013*64 */ - psraw_i2r (6, mm0); /* red=red/64 */ - psraw_i2r (6, mm1); /* red=red/64 */ + movq_r2r (mm1, mm0); /* r1 r1 r0 r0 r1 r1 r0 r0 */ + pmullw_m2r (MMX32_Vgrncoeff, mm0); /* red*-46dec=0.7136*64 */ + pmullw_m2r (MMX32_Vredcoeff, mm1); /* red*89dec=1.4013*64 */ + psraw_i2r (6, mm0); /* red=red/64 */ + psraw_i2r (6, mm1); /* red=red/64 */ /* create L1 L2 (result in mm2,mm4) */ /* L2=lum+cols */ - movq_m2r (*(mmx_t *) (lum + cols), mm3); /* 0 0 0 0 L3 L2 L1 L0 */ - punpckldq_r2r (mm3, mm2); /* L3 L2 L1 L0 l3 l2 l1 l0 */ - movq_r2r (mm2, mm4); /* L3 L2 L1 L0 l3 l2 l1 l0 */ - pand_m2r (MMX_FF00w, mm2); /* L3 0 L1 0 l3 0 l1 0 */ - pand_m2r (MMX_00FFw, mm4); /* 0 L2 0 L0 0 l2 0 l0 */ - psrlw_i2r (8, mm2); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_m2r (*(mmx_t *) (lum + cols), mm3); /* 0 0 0 0 L3 L2 L1 L0 */ + punpckldq_r2r (mm3, mm2); /* L3 L2 L1 L0 l3 l2 l1 l0 */ + movq_r2r (mm2, mm4); /* L3 L2 L1 L0 l3 l2 l1 l0 */ + pand_m2r (MMX_FF00w, mm2); /* L3 0 L1 0 l3 0 l1 0 */ + pand_m2r (MMX_00FFw, mm4); /* 0 L2 0 L0 0 l2 0 l0 */ + psrlw_i2r (8, mm2); /* 0 L3 0 L1 0 l3 0 l1 */ /* create R (result in mm6) */ - movq_r2r (mm2, mm5); /* 0 L3 0 L1 0 l3 0 l1 */ - movq_r2r (mm4, mm6); /* 0 L2 0 L0 0 l2 0 l0 */ - paddsw_r2r (mm1, mm5); /* lum1+red:x R3 x R1 x r3 x r1 */ - paddsw_r2r (mm1, mm6); /* lum1+red:x R2 x R0 x r2 x r0 */ - packuswb_r2r (mm5, mm5); /* R3 R1 r3 r1 R3 R1 r3 r1 */ - packuswb_r2r (mm6, mm6); /* R2 R0 r2 r0 R2 R0 r2 r0 */ - pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ - punpcklbw_r2r (mm5, mm6); /* R3 R2 R1 R0 r3 r2 r1 r0 */ + movq_r2r (mm2, mm5); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_r2r (mm4, mm6); /* 0 L2 0 L0 0 l2 0 l0 */ + paddsw_r2r (mm1, mm5); /* lum1+red:x R3 x R1 x r3 x r1 */ + paddsw_r2r (mm1, mm6); /* lum1+red:x R2 x R0 x r2 x r0 */ + packuswb_r2r (mm5, mm5); /* R3 R1 r3 r1 R3 R1 r3 r1 */ + packuswb_r2r (mm6, mm6); /* R2 R0 r2 r0 R2 R0 r2 r0 */ + pxor_r2r (mm7, mm7); /* 00 00 00 00 00 00 00 00 */ + punpcklbw_r2r (mm5, mm6); /* R3 R2 R1 R0 r3 r2 r1 r0 */ /* create Cb (result in mm1) */ - movd_m2r (*(mmx_t *) cr, mm1); /* 0 0 0 0 u3 u2 u1 u0 */ - punpcklbw_r2r (mm7, mm1); /* 0 u3 0 u2 00 u1 00 u0 */ - punpckldq_r2r (mm1, mm1); /* 00 u1 00 u0 00 u1 00 u0 */ - psubw_m2r (MMX_80w, mm1); /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */ + movd_m2r (*(mmx_t *) cr, mm1); /* 0 0 0 0 u3 u2 u1 u0 */ + punpcklbw_r2r (mm7, mm1); /* 0 u3 0 u2 00 u1 00 u0 */ + punpckldq_r2r (mm1, mm1); /* 00 u1 00 u0 00 u1 00 u0 */ + psubw_m2r (MMX_80w, mm1); /* mm1-128:u1 u1 u0 u0 u1 u1 u0 u0 */ /* create Cb_g (result in mm5) */ - movq_r2r (mm1, mm5); /* u1 u1 u0 u0 u1 u1 u0 u0 */ - pmullw_m2r (MMX32_Ugrncoeff, mm5); /* blue*-109dec=1.7129*64 */ - pmullw_m2r (MMX32_Ubluecoeff, mm1); /* blue*114dec=1.78125*64 */ - psraw_i2r (6, mm5); /* blue=red/64 */ - psraw_i2r (6, mm1); /* blue=blue/64 */ + movq_r2r (mm1, mm5); /* u1 u1 u0 u0 u1 u1 u0 u0 */ + pmullw_m2r (MMX32_Ugrncoeff, mm5); /* blue*-109dec=1.7129*64 */ + pmullw_m2r (MMX32_Ubluecoeff, mm1); /* blue*114dec=1.78125*64 */ + psraw_i2r (6, mm5); /* blue=red/64 */ + psraw_i2r (6, mm1); /* blue=blue/64 */ /* create G (result in mm7) */ - movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ - movq_r2r (mm4, mm7); /* 0 L2 0 L0 0 l2 0 l1 */ - paddsw_r2r (mm5, mm3); /* lum1+Cb_g:x G3t x G1t x g3t x g1t */ - paddsw_r2r (mm5, mm7); /* lum1+Cb_g:x G2t x G0t x g2t x g0t */ - paddsw_r2r (mm0, mm3); /* lum1+Cr_g:x G3 x G1 x g3 x g1 */ - paddsw_r2r (mm0, mm7); /* lum1+blue:x G2 x G0 x g2 x g0 */ - packuswb_r2r (mm3, mm3); /* G3 G1 g3 g1 G3 G1 g3 g1 */ - packuswb_r2r (mm7, mm7); /* G2 G0 g2 g0 G2 G0 g2 g0 */ - punpcklbw_r2r (mm3, mm7); /* G3 G2 G1 G0 g3 g2 g1 g0 */ + movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_r2r (mm4, mm7); /* 0 L2 0 L0 0 l2 0 l1 */ + paddsw_r2r (mm5, mm3); /* lum1+Cb_g:x G3t x G1t x g3t x g1t */ + paddsw_r2r (mm5, mm7); /* lum1+Cb_g:x G2t x G0t x g2t x g0t */ + paddsw_r2r (mm0, mm3); /* lum1+Cr_g:x G3 x G1 x g3 x g1 */ + paddsw_r2r (mm0, mm7); /* lum1+blue:x G2 x G0 x g2 x g0 */ + packuswb_r2r (mm3, mm3); /* G3 G1 g3 g1 G3 G1 g3 g1 */ + packuswb_r2r (mm7, mm7); /* G2 G0 g2 g0 G2 G0 g2 g0 */ + punpcklbw_r2r (mm3, mm7); /* G3 G2 G1 G0 g3 g2 g1 g0 */ /* create B (result in mm5) */ - movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ - movq_r2r (mm4, mm5); /* 0 L2 0 L0 0 l2 0 l1 */ - paddsw_r2r (mm1, mm3); /* lum1+blue:x B3 x B1 x b3 x b1 */ - paddsw_r2r (mm1, mm5); /* lum1+blue:x B2 x B0 x b2 x b0 */ - packuswb_r2r (mm3, mm3); /* B3 B1 b3 b1 B3 B1 b3 b1 */ - packuswb_r2r (mm5, mm5); /* B2 B0 b2 b0 B2 B0 b2 b0 */ - punpcklbw_r2r (mm3, mm5); /* B3 B2 B1 B0 b3 b2 b1 b0 */ + movq_r2r (mm2, mm3); /* 0 L3 0 L1 0 l3 0 l1 */ + movq_r2r (mm4, mm5); /* 0 L2 0 L0 0 l2 0 l1 */ + paddsw_r2r (mm1, mm3); /* lum1+blue:x B3 x B1 x b3 x b1 */ + paddsw_r2r (mm1, mm5); /* lum1+blue:x B2 x B0 x b2 x b0 */ + packuswb_r2r (mm3, mm3); /* B3 B1 b3 b1 B3 B1 b3 b1 */ + packuswb_r2r (mm5, mm5); /* B2 B0 b2 b0 B2 B0 b2 b0 */ + punpcklbw_r2r (mm3, mm5); /* B3 B2 B1 B0 b3 b2 b1 b0 */ /* fill destination row1 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */ - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - pxor_r2r (mm4, mm4); /* 0 0 0 0 0 0 0 0 */ - movq_r2r (mm6, mm1); /* R3 R2 R1 R0 r3 r2 r1 r0 */ - movq_r2r (mm5, mm3); /* B3 B2 B1 B0 b3 b2 b1 b0 */ + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + pxor_r2r (mm4, mm4); /* 0 0 0 0 0 0 0 0 */ + movq_r2r (mm6, mm1); /* R3 R2 R1 R0 r3 r2 r1 r0 */ + movq_r2r (mm5, mm3); /* B3 B2 B1 B0 b3 b2 b1 b0 */ /* process lower lum */ - punpcklbw_r2r (mm4, mm1); /* 0 r3 0 r2 0 r1 0 r0 */ - punpcklbw_r2r (mm4, mm3); /* 0 b3 0 b2 0 b1 0 b0 */ - movq_r2r (mm1, mm2); /* 0 r3 0 r2 0 r1 0 r0 */ - movq_r2r (mm3, mm0); /* 0 b3 0 b2 0 b1 0 b0 */ - punpcklwd_r2r (mm1, mm3); /* 0 r1 0 b1 0 r0 0 b0 */ - punpckhwd_r2r (mm2, mm0); /* 0 r3 0 b3 0 r2 0 b2 */ - - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - movq_r2r (mm7, mm1); /* G3 G2 G1 G0 g3 g2 g1 g0 */ - punpcklbw_r2r (mm1, mm2); /* g3 0 g2 0 g1 0 g0 0 */ - punpcklwd_r2r (mm4, mm2); /* 0 0 g1 0 0 0 g0 0 */ - por_r2r (mm3, mm2); /* 0 r1 g1 b1 0 r0 g0 b0 */ - movq_r2m (mm2, *(mmx_t *) row1); /* wrote out ! row1 */ - - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - punpcklbw_r2r (mm1, mm4); /* g3 0 g2 0 g1 0 g0 0 */ - punpckhwd_r2r (mm2, mm4); /* 0 0 g3 0 0 0 g2 0 */ - por_r2r (mm0, mm4); /* 0 r3 g3 b3 0 r2 g2 b2 */ - movq_r2m (mm4, *(mmx_t *) (row1 + 2)); /* wrote out ! row1 */ + punpcklbw_r2r (mm4, mm1); /* 0 r3 0 r2 0 r1 0 r0 */ + punpcklbw_r2r (mm4, mm3); /* 0 b3 0 b2 0 b1 0 b0 */ + movq_r2r (mm1, mm2); /* 0 r3 0 r2 0 r1 0 r0 */ + movq_r2r (mm3, mm0); /* 0 b3 0 b2 0 b1 0 b0 */ + punpcklwd_r2r (mm1, mm3); /* 0 r1 0 b1 0 r0 0 b0 */ + punpckhwd_r2r (mm2, mm0); /* 0 r3 0 b3 0 r2 0 b2 */ + + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + movq_r2r (mm7, mm1); /* G3 G2 G1 G0 g3 g2 g1 g0 */ + punpcklbw_r2r (mm1, mm2); /* g3 0 g2 0 g1 0 g0 0 */ + punpcklwd_r2r (mm4, mm2); /* 0 0 g1 0 0 0 g0 0 */ + por_r2r (mm3, mm2); /* 0 r1 g1 b1 0 r0 g0 b0 */ + movq_r2m (mm2, *(mmx_t *) row1); /* wrote out ! row1 */ + + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + punpcklbw_r2r (mm1, mm4); /* g3 0 g2 0 g1 0 g0 0 */ + punpckhwd_r2r (mm2, mm4); /* 0 0 g3 0 0 0 g2 0 */ + por_r2r (mm0, mm4); /* 0 r3 g3 b3 0 r2 g2 b2 */ + movq_r2m (mm4, *(mmx_t *) (row1 + 2)); /* wrote out ! row1 */ /* fill destination row2 (needed are mm6=Rr,mm7=Gg,mm5=Bb) */ /* this can be done "destructive" */ - pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ - punpckhbw_r2r (mm2, mm6); /* 0 R3 0 R2 0 R1 0 R0 */ - punpckhbw_r2r (mm1, mm5); /* G3 B3 G2 B2 G1 B1 G0 B0 */ - movq_r2r (mm5, mm1); /* G3 B3 G2 B2 G1 B1 G0 B0 */ - punpcklwd_r2r (mm6, mm1); /* 0 R1 G1 B1 0 R0 G0 B0 */ - movq_r2m (mm1, *(mmx_t *) (row1 + cols)); /* wrote out ! row2 */ - punpckhwd_r2r (mm6, mm5); /* 0 R3 G3 B3 0 R2 G2 B2 */ - movq_r2m (mm5, *(mmx_t *) (row1 + cols + 2)); /* wrote out ! row2 */ + pxor_r2r (mm2, mm2); /* 0 0 0 0 0 0 0 0 */ + punpckhbw_r2r (mm2, mm6); /* 0 R3 0 R2 0 R1 0 R0 */ + punpckhbw_r2r (mm1, mm5); /* G3 B3 G2 B2 G1 B1 G0 B0 */ + movq_r2r (mm5, mm1); /* G3 B3 G2 B2 G1 B1 G0 B0 */ + punpcklwd_r2r (mm6, mm1); /* 0 R1 G1 B1 0 R0 G0 B0 */ + movq_r2m (mm1, *(mmx_t *) (row1 + cols)); /* wrote out ! row2 */ + punpckhwd_r2r (mm6, mm5); /* 0 R3 G3 B3 0 R2 G2 B2 */ + movq_r2m (mm5, *(mmx_t *) (row1 + cols + 2)); /* wrote out ! row2 */ lum += 4; cr += 2; diff --git a/gst/deinterlace/gstdeinterlace.c b/gst/deinterlace/gstdeinterlace.c index 8b174e39..93a2bdb2 100644 --- a/gst/deinterlace/gstdeinterlace.c +++ b/gst/deinterlace/gstdeinterlace.c @@ -99,9 +99,10 @@ gst_deinterlace_get_type (void) 0, (GInstanceInitFunc) gst_deinterlace_init, }; + deinterlace_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstDeInterlace", - &deinterlace_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstDeInterlace", + &deinterlace_info, 0); } return deinterlace_type; } @@ -130,10 +131,10 @@ gst_deinterlace_class_init (GstDeInterlaceClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DI_ONLY, g_param_spec_boolean ("di_area_only", "di_area_only", "di_area_only", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BLEND, g_param_spec_boolean ("blend", "blend", "blend", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_THRESHOLD, g_param_spec_int ("threshold", "threshold", "threshold", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_EDGE_DETECT, g_param_spec_int ("edge_detect", "edge_detect", "edge_detect", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DI_ONLY, g_param_spec_boolean ("di_area_only", "di_area_only", "di_area_only", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BLEND, g_param_spec_boolean ("blend", "blend", "blend", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_THRESHOLD, g_param_spec_int ("threshold", "threshold", "threshold", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_EDGE_DETECT, g_param_spec_int ("edge_detect", "edge_detect", "edge_detect", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_deinterlace_set_property; gobject_class->get_property = gst_deinterlace_get_property; @@ -227,7 +228,7 @@ gst_deinterlace_chain (GstPad * pad, GstData * _data) memcpy (filter->src, yuvptr, filter->picsize); - y_dst = yuvptr; /* dst y pointer */ + y_dst = yuvptr; /* dst y pointer */ /* we should not change u,v because one u, v value stands for */ /* 2 pixels per 2 lines = 4 pixel and we don't want to change */ /* the color of */ @@ -241,7 +242,7 @@ gst_deinterlace_chain (GstPad * pad, GstData * _data) iEdgeDetect = 180; iEdgeDetect = iEdgeDetect * iEdgeDetect; - y1 = 0; /* Avoid compiler warning. The value is not used. */ + y1 = 0; /* Avoid compiler warning. The value is not used. */ for (x = 0; x < width; x++) { psrc3 = y_src + x; y3 = *psrc3; @@ -257,49 +258,49 @@ gst_deinterlace_chain (GstPad * pad, GstData * _data) y1 = y2; y2 = y3; if (y < height - 1) { - y3 = *psrc3; + y3 = *psrc3; } else { - y3 = y1; + y3 = y1; } iInterlaceValue0 = iInterlaceValue1; iInterlaceValue1 = iInterlaceValue2; if (y < height) - iInterlaceValue2 = ((y1 - y2) * (y3 - y2) - - ((iEdgeDetect * (y1 - y3) * (y1 - y3)) >> 12)) * 10; + iInterlaceValue2 = ((y1 - y2) * (y3 - y2) - + ((iEdgeDetect * (y1 - y3) * (y1 - y3)) >> 12)) * 10; else - iInterlaceValue2 = 0; + iInterlaceValue2 = 0; if (y > 0) { - if (iInterlaceValue0 + 2 * iInterlaceValue1 + iInterlaceValue2 > - iThreshold) { - if (bBlend) { - *pdst1 = (unsigned char) ((y0 + 2 * y1 + y2) >> 2); - } else { - /* this method seems to work better than blending if the */ - /* quality is pretty bad and the half pics don't fit together */ - if ((y % 2) == 1) { /* if odd simply copy the value */ - *pdst1 = *psrc1; - /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ - } else { /* even interpolate the even line (upper + lower)/2 */ - *pdst1 = (unsigned char) ((y0 + y2) >> 1); - /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ - } - } - } else { - /* so we went below the treshold and therefore we don't have to */ - /* change anything */ - if (bShowDeinterlacedAreaOnly) { - /* this is for testing to see how we should tune the treshhold */ - /* and shows as the things that haven't change because the */ - /* threshhold was to low?? (or shows that everything is ok :-) */ - *pdst1 = 0; /* blank the point and so the interlac area */ - } else { - *pdst1 = *psrc1; - } - } - pdst1 = pdst1 + y_line; + if (iInterlaceValue0 + 2 * iInterlaceValue1 + iInterlaceValue2 > + iThreshold) { + if (bBlend) { + *pdst1 = (unsigned char) ((y0 + 2 * y1 + y2) >> 2); + } else { + /* this method seems to work better than blending if the */ + /* quality is pretty bad and the half pics don't fit together */ + if ((y % 2) == 1) { /* if odd simply copy the value */ + *pdst1 = *psrc1; + /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ + } else { /* even interpolate the even line (upper + lower)/2 */ + *pdst1 = (unsigned char) ((y0 + y2) >> 1); + /**pdst1 = 0; // FIXME this is for adjusting an initial iThreshold */ + } + } + } else { + /* so we went below the treshold and therefore we don't have to */ + /* change anything */ + if (bShowDeinterlacedAreaOnly) { + /* this is for testing to see how we should tune the treshhold */ + /* and shows as the things that haven't change because the */ + /* threshhold was to low?? (or shows that everything is ok :-) */ + *pdst1 = 0; /* blank the point and so the interlac area */ + } else { + *pdst1 = *psrc1; + } + } + pdst1 = pdst1 + y_line; } } } @@ -370,7 +371,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "deinterlace", GST_RANK_NONE, - gst_deinterlace_get_type ())) + gst_deinterlace_get_type ())) return FALSE; return TRUE; diff --git a/gst/festival/gstfestival.c b/gst/festival/gstfestival.c index 977455bd..a7b6dad0 100644 --- a/gst/festival/gstfestival.c +++ b/gst/festival/gstfestival.c @@ -107,10 +107,10 @@ GST_STATIC_PAD_TEMPLATE ("festival_src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/x-raw-int, " - "endianness = (int) BYTE_ORDER, " - "signed = (boolean) TRUE, " - "width = (int) 16, " - "depth = (int) 16, " "rate = (int) 16000, " "channels = (int) 1") + "endianness = (int) BYTE_ORDER, " + "signed = (boolean) TRUE, " + "width = (int) 16, " + "depth = (int) 16, " "rate = (int) 16000, " "channels = (int) 1") ); /* Festival signals and args */ @@ -147,9 +147,10 @@ gst_festival_get_type (void) 0, (GInstanceInitFunc) gst_festival_init, }; + festival_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstFestival", &festival_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstFestival", &festival_info, + 0); } return festival_type; } @@ -241,12 +242,12 @@ gst_festival_chain (GstPad * pad, GstData * _data) for (n = 0; n < 3;) n += read (festival->info->server_fd, ack + n, 3 - n); ack[3] = '\0'; - if (strcmp (ack, "WV\n") == 0) /* receive a waveform */ + if (strcmp (ack, "WV\n") == 0) /* receive a waveform */ wavefile = - socket_receive_file_to_buff (festival->info->server_fd, &filesize); - else if (strcmp (ack, "LP\n") == 0) /* receive an s-expr */ + socket_receive_file_to_buff (festival->info->server_fd, &filesize); + else if (strcmp (ack, "LP\n") == 0) /* receive an s-expr */ client_accept_s_expr (festival->info->server_fd); - else if (strcmp (ack, "ER\n") == 0) { /* server got an error */ + else if (strcmp (ack, "ER\n") == 0) { /* server got an error */ fprintf (stderr, "festival_client: server returned error\n"); break; } @@ -337,7 +338,7 @@ socket_receive_file_to_buff (int fd, int *size) /* Festival key stuff technique, but long winded I know, sorry */ /* but will receive any file without closeing the stream or */ /* using OOB data */ - static const char *file_stuff_key = "ft_StUfF_key"; /* must == Festival's key */ + static const char *file_stuff_key = "ft_StUfF_key"; /* must == Festival's key */ char *buff; int bufflen; int n, k, i; @@ -350,7 +351,7 @@ socket_receive_file_to_buff (int fd, int *size) for (k = 0; file_stuff_key[k] != '\0';) { n = read (fd, &c, 1); if (n == 0) - break; /* hit stream eof before end of file */ + break; /* hit stream eof before end of file */ if ((*size) + k + 1 >= bufflen) { /* +1 so you can add a NULL if you want */ bufflen += bufflen / 4; @@ -361,12 +362,12 @@ socket_receive_file_to_buff (int fd, int *size) else if ((c == 'X') && (file_stuff_key[k + 1] == '\0')) { /* It looked like the key but wasn't */ for (i = 0; i < k; i++, (*size)++) - buff[*size] = file_stuff_key[i]; + buff[*size] = file_stuff_key[i]; k = 0; /* omit the stuffed 'X' */ } else { for (i = 0; i < k; i++, (*size)++) - buff[*size] = file_stuff_key[i]; + buff[*size] = file_stuff_key[i]; k = 0; buff[*size] = c; (*size)++; @@ -419,7 +420,7 @@ gst_festival_change_state (GstElement * element) } else { if (!GST_FLAG_IS_SET (element, GST_FESTIVAL_OPEN)) { if (!gst_festival_open (GST_FESTIVAL (element))) - return GST_STATE_FAILURE; + return GST_STATE_FAILURE; } } @@ -433,7 +434,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "festival", GST_RANK_NONE, - GST_TYPE_FESTIVAL)) + GST_TYPE_FESTIVAL)) return FALSE; return TRUE; diff --git a/gst/filter/gstbpwsinc.c b/gst/filter/gstbpwsinc.c index a848cc26..ba0f2d67 100644 --- a/gst/filter/gstbpwsinc.c +++ b/gst/filter/gstbpwsinc.c @@ -35,8 +35,8 @@ #endif #include #include "gstfilter.h" -#include /* M_PI */ -#include /* memmove */ +#include /* M_PI */ +#include /* memmove */ /* elementfactory information */ static GstElementDetails gst_bpwsinc_details = GST_ELEMENT_DETAILS ("BPWSinc", @@ -80,10 +80,10 @@ struct _GstBPWSinc double frequency; double lower_frequency, upper_frequency; - int wing_size; /* length of a "wing" of the filter; - actual length is 2 * wing_size + 1 */ + int wing_size; /* length of a "wing" of the filter; + actual length is 2 * wing_size + 1 */ - gfloat *residue; /* buffer for left-over samples from previous buffer */ + gfloat *residue; /* buffer for left-over samples from previous buffer */ double *kernel; }; @@ -125,7 +125,7 @@ gst_bpwsinc_get_type (void) }; bpwsinc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstBPWSinc", - &bpwsinc_info, 0); + &bpwsinc_info, 0); } return bpwsinc_type; } @@ -157,16 +157,16 @@ gst_bpwsinc_class_init (GstBPWSincClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LOWER_FREQUENCY, g_param_spec_double ("lower-frequency", "Lower Frequency", - "Cut-off lower frequency (relative to sample rate)", - 0.0, 0.5, 0, G_PARAM_READWRITE)); + "Cut-off lower frequency (relative to sample rate)", + 0.0, 0.5, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_UPPER_FREQUENCY, g_param_spec_double ("upper-frequency", "Upper Frequency", - "Cut-off upper frequency (relative to sample rate)", - 0.0, 0.5, 0, G_PARAM_READWRITE)); + "Cut-off upper frequency (relative to sample rate)", + 0.0, 0.5, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LENGTH, g_param_spec_int ("length", "Length", - "N such that the filter length = 2N + 1", - 1, G_MAXINT, 1, G_PARAM_READWRITE)); + "N such that the filter length = 2N + 1", + 1, G_MAXINT, 1, G_PARAM_READWRITE)); gobject_class->set_property = gst_bpwsinc_set_property; gobject_class->get_property = gst_bpwsinc_get_property; @@ -213,17 +213,17 @@ gst_bpwsinc_sink_connect (GstPad * pad, const GstCaps * caps) len = filter->wing_size; /* fill the lp kernel */ GST_DEBUG ("bpwsinc: initializing LP kernel of length %d with cut-off %f", - len * 2 + 1, filter->lower_frequency); + len * 2 + 1, filter->lower_frequency); kernel_lp = (double *) g_malloc (sizeof (double) * (2 * len + 1)); for (i = 0; i <= len * 2; ++i) { if (i == len) - kernel_lp[i] = 2 * M_PI * filter->lower_frequency; + kernel_lp[i] = 2 * M_PI * filter->lower_frequency; else - kernel_lp[i] = sin (2 * M_PI * filter->lower_frequency * (i - len)) - / (i - len); + kernel_lp[i] = sin (2 * M_PI * filter->lower_frequency * (i - len)) + / (i - len); /* Blackman windowing */ kernel_lp[i] *= (0.42 - 0.5 * cos (M_PI * i / len) - + 0.08 * cos (2 * M_PI * i / len)); + + 0.08 * cos (2 * M_PI * i / len)); } /* normalize for unity gain at DC @@ -236,17 +236,17 @@ gst_bpwsinc_sink_connect (GstPad * pad, const GstCaps * caps) /* fill the hp kernel */ GST_DEBUG ("bpwsinc: initializing HP kernel of length %d with cut-off %f", - len * 2 + 1, filter->upper_frequency); + len * 2 + 1, filter->upper_frequency); kernel_hp = (double *) g_malloc (sizeof (double) * (2 * len + 1)); for (i = 0; i <= len * 2; ++i) { if (i == len) - kernel_hp[i] = 2 * M_PI * filter->upper_frequency; + kernel_hp[i] = 2 * M_PI * filter->upper_frequency; else - kernel_hp[i] = sin (2 * M_PI * filter->upper_frequency * (i - len)) - / (i - len); + kernel_hp[i] = sin (2 * M_PI * filter->upper_frequency * (i - len)) + / (i - len); /* Blackman windowing */ kernel_hp[i] *= (0.42 - 0.5 * cos (M_PI * i / len) - + 0.08 * cos (2 * M_PI * i / len)); + + 0.08 * cos (2 * M_PI * i / len)); } /* normalize for unity gain at DC diff --git a/gst/filter/gstfilter.c b/gst/filter/gstfilter.c index f723ae63..0fbc9609 100644 --- a/gst/filter/gstfilter.c +++ b/gst/filter/gstfilter.c @@ -59,7 +59,7 @@ plugin_init (GstPlugin * plugin) while (_elements[i].name) { if (!gst_element_register (plugin, _elements[i].name, GST_RANK_NONE, - _elements[i].type ())) + _elements[i].type ())) return FALSE; i++; diff --git a/gst/filter/gstiir.c b/gst/filter/gstiir.c index 5e44f3d0..2f69ae6a 100644 --- a/gst/filter/gstiir.c +++ b/gst/filter/gstiir.c @@ -109,7 +109,7 @@ gst_iir_get_type (void) }; iir_type = g_type_register_static (GST_TYPE_ELEMENT, "GstIIR", - &iir_info, 0); + &iir_info, 0); } return iir_type; } @@ -141,16 +141,16 @@ gst_iir_class_init (GstIIRClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_A, g_param_spec_double ("A", "A", "A filter coefficient", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); + -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_B, g_param_spec_double ("B", "B", "B filter coefficient", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); + -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_GAIN, g_param_spec_double ("gain", "Gain", "Filter gain", - -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); + -G_MAXDOUBLE, G_MAXDOUBLE, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STAGES, g_param_spec_int ("stages", "Stages", "Number of filter stages", - 1, G_MAXINT, 1, G_PARAM_READWRITE)); + 1, G_MAXINT, 1, G_PARAM_READWRITE)); gobject_class->set_property = gst_iir_set_property; gobject_class->get_property = gst_iir_get_property; @@ -173,7 +173,7 @@ gst_iir_init (GstIIR * filter) filter->A = 0.0; filter->B = 0.0; - filter->gain = 1.0; /* unity gain as default */ + filter->gain = 1.0; /* unity gain as default */ filter->stages = 1; filter->state = NULL; } @@ -192,7 +192,7 @@ gst_iir_sink_connect (GstPad * pad, const GstCaps * caps) /* FIXME: remember to free it */ filter->state = (IIR_state *) g_malloc (sizeof (IIR_state)); IIR_init (filter->state, filter->stages, - filter->gain, &(filter->A), &(filter->B)); + filter->gain, &(filter->A), &(filter->B)); } return set_retval; diff --git a/gst/filter/gstlpwsinc.c b/gst/filter/gstlpwsinc.c index 0ce33b32..285c2edb 100644 --- a/gst/filter/gstlpwsinc.c +++ b/gst/filter/gstlpwsinc.c @@ -35,8 +35,8 @@ #endif #include #include "gstfilter.h" -#include /* M_PI */ -#include /* memmove */ +#include /* M_PI */ +#include /* memmove */ static GstElementDetails gst_lpwsinc_details = GST_ELEMENT_DETAILS ("LPWSinc", "Filter/Effect/Audio", @@ -77,10 +77,10 @@ struct _GstLPWSinc GstPad *sinkpad, *srcpad; double frequency; - int wing_size; /* length of a "wing" of the filter; - actual length is 2 * wing_size + 1 */ + int wing_size; /* length of a "wing" of the filter; + actual length is 2 * wing_size + 1 */ - gfloat *residue; /* buffer for left-over samples from previous buffer */ + gfloat *residue; /* buffer for left-over samples from previous buffer */ double *kernel; }; @@ -122,7 +122,7 @@ gst_lpwsinc_get_type (void) }; lpwsinc_type = g_type_register_static (GST_TYPE_ELEMENT, "GstLPWSinc", - &lpwsinc_info, 0); + &lpwsinc_info, 0); } return lpwsinc_type; } @@ -154,12 +154,12 @@ gst_lpwsinc_class_init (GstLPWSincClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FREQUENCY, g_param_spec_double ("frequency", "Frequency", - "Cut-off Frequency relative to sample rate)", - 0.0, 0.5, 0, G_PARAM_READWRITE)); + "Cut-off Frequency relative to sample rate)", + 0.0, 0.5, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LENGTH, g_param_spec_int ("length", "Length", - "N such that the filter length = 2N + 1", - 1, G_MAXINT, 1, G_PARAM_READWRITE)); + "N such that the filter length = 2N + 1", + 1, G_MAXINT, 1, G_PARAM_READWRITE)); gobject_class->set_property = gst_lpwsinc_set_property; gobject_class->get_property = gst_lpwsinc_get_property; @@ -210,10 +210,10 @@ gst_lpwsinc_sink_connect (GstPad * pad, const GstCaps * caps) for (i = 0; i <= len * 2; ++i) { if (i == len) - filter->kernel[i] = 2 * M_PI * filter->frequency; + filter->kernel[i] = 2 * M_PI * filter->frequency; else - filter->kernel[i] = sin (2 * M_PI * filter->frequency * (i - len)) - / (i - len); + filter->kernel[i] = sin (2 * M_PI * filter->frequency * (i - len)) + / (i - len); /* windowing */ filter->kernel[i] *= (0.54 - 0.46 * cos (M_PI * i / len)); } diff --git a/gst/flx/gstflxdec.c b/gst/flx/gstflxdec.c index a84ce2d2..b2694962 100644 --- a/gst/flx/gstflxdec.c +++ b/gst/flx/gstflxdec.c @@ -103,8 +103,9 @@ gst_flxdec_get_type (void) 0, (GInstanceInitFunc) gst_flxdec_init, }; + flxdec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstFlxDec", &flxdec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstFlxDec", &flxdec_info, 0); } return flxdec_type; } @@ -172,44 +173,44 @@ flx_decode_chunks (GstFlxDec * flxdec, gulong count, gchar * data, gchar * dest) switch (hdr->id) { case FLX_COLOR64: - flx_decode_color (flxdec, data, dest, 2); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_color (flxdec, data, dest, 2); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_COLOR256: - flx_decode_color (flxdec, data, dest, 0); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_color (flxdec, data, dest, 0); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_BRUN: - flx_decode_brun (flxdec, data, dest); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_brun (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_LC: - flx_decode_delta_fli (flxdec, data, dest); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_delta_fli (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_SS2: - flx_decode_delta_flc (flxdec, data, dest); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + flx_decode_delta_flc (flxdec, data, dest); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; case FLX_BLACK: - memset (dest, 0, flxdec->size); - break; + memset (dest, 0, flxdec->size); + break; case FLX_MINI: - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; default: - g_print ("GstFlxDec: Unimplented chunk type: 0x%02x size: %d\n", - hdr->id, hdr->size); - g_print ("GstFlxDec: Skipping...\n"); - data += rndalign (hdr->size) - FlxFrameChunkSize; - break; + g_print ("GstFlxDec: Unimplented chunk type: 0x%02x size: %d\n", + hdr->id, hdr->size); + g_print ("GstFlxDec: Skipping...\n"); + data += rndalign (hdr->size) - FlxFrameChunkSize; + break; } } } @@ -266,20 +267,20 @@ flx_decode_brun (GstFlxDec * flxdec, guchar * data, guchar * dest) count = *data++; if (count > 0x7f) { - /* literal run */ - count = 0x100 - count; - row -= count; + /* literal run */ + count = 0x100 - count; + row -= count; - while (count--) - *dest++ = *data++; + while (count--) + *dest++ = *data++; } else { - /* replicate run */ - row -= count; - x = *data++; + /* replicate run */ + row -= count; + x = *data++; - while (count--) - *dest++ = x; + while (count--) + *dest++ = x; } } } @@ -320,17 +321,17 @@ flx_decode_delta_fli (GstFlxDec * flxdec, guchar * data, guchar * dest) count = *data++; if (count > 0x7f) { - /* literal run */ - count = 0x100 - count; - x = *data++; + /* literal run */ + count = 0x100 - count; + x = *data++; - while (count--) - *dest++ = x; + while (count--) + *dest++ = x; } else { - /* replicate run */ - while (count--) - *dest++ = *data++; + /* replicate run */ + while (count--) + *dest++ = *data++; } } start_p += flxdec->hdr.width; @@ -365,13 +366,13 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) while ((opcode = (data[0] + (data[1] << 8))) & 0xc000) { data += 2; if ((opcode & 0xc000) == 0xc000) { - /* skip count */ - start_l += (0x10000 - opcode); - dest += flxdec->hdr.width * (0x10000 - opcode); + /* skip count */ + start_l += (0x10000 - opcode); + dest += flxdec->hdr.width * (0x10000 - opcode); } else { - /* last pixel */ - dest += flxdec->hdr.width; - *dest++ = (opcode & 0xff); + /* last pixel */ + dest += flxdec->hdr.width; + *dest++ = (opcode & 0xff); } } data += 2; @@ -385,19 +386,19 @@ flx_decode_delta_flc (GstFlxDec * flxdec, guchar * data, guchar * dest) count = *data++; if (count > 0x7f) { - /* replicate word run */ - count = 0x100 - count; - while (count--) { - *dest++ = data[0]; - *dest++ = data[1]; - } - data += 2; + /* replicate word run */ + count = 0x100 - count; + while (count--) { + *dest++ = data[0]; + *dest++ = data[1]; + } + data += 2; } else { - /* literal word run */ - while (count--) { - *dest++ = *data++; - *dest++ = *data++; - } + /* literal word run */ + while (count--) { + *dest++ = *data++; + *dest++ = *data++; + } } } lines--; @@ -462,9 +463,9 @@ gst_flxdec_loop (GstElement * element) /* check header */ if (flxh->type != FLX_MAGICHDR_FLI && - flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) { + flxh->type != FLX_MAGICHDR_FLC && flxh->type != FLX_MAGICHDR_FLX) { GST_ELEMENT_ERROR (element, STREAM, WRONG_TYPE, (NULL), - ("not a flx file (type %d)\n", flxh->type)); + ("not a flx file (type %d)\n", flxh->type)); return; } @@ -486,13 +487,13 @@ gst_flxdec_loop (GstElement * element) caps = gst_caps_from_string (GST_VIDEO_CAPS_xRGB_HOST_ENDIAN); gst_caps_set_simple (caps, - "width", G_TYPE_INT, flxh->width, - "height", G_TYPE_INT, flxh->height, - "framerate", G_TYPE_DOUBLE, GST_SECOND / flxdec->frame_time, NULL); + "width", G_TYPE_INT, flxh->width, + "height", G_TYPE_INT, flxh->height, + "framerate", G_TYPE_DOUBLE, GST_SECOND / flxdec->frame_time, NULL); if (flxh->depth <= 8) flxdec->converter = - flx_colorspace_converter_new (flxh->width, flxh->height); + flx_colorspace_converter_new (flxh->width, flxh->height); if (flxh->type == FLX_MAGICHDR_FLC || flxh->type == FLX_MAGICHDR_FLX) { g_print ("GstFlxDec: (FLC) aspect_dx : %d\n", flxh->aspect_dx); @@ -523,41 +524,41 @@ gst_flxdec_loop (GstElement * element) switch (flxfh->id) { case FLX_FRAME_TYPE: - buf = flx_get_data (flxdec, flxfh->size - FlxFrameChunkSize); + buf = flx_get_data (flxdec, flxfh->size - FlxFrameChunkSize); - chunk = GST_BUFFER_DATA (buf); + chunk = GST_BUFFER_DATA (buf); - if (((FlxFrameType *) chunk)->chunks == 0) - break; + if (((FlxFrameType *) chunk)->chunks == 0) + break; - /* create 32 bits output frame */ - out = gst_buffer_new (); - GST_BUFFER_DATA (out) = g_malloc (flxdec->size * 4); - GST_BUFFER_SIZE (out) = flxdec->size * 4; + /* create 32 bits output frame */ + out = gst_buffer_new (); + GST_BUFFER_DATA (out) = g_malloc (flxdec->size * 4); + GST_BUFFER_SIZE (out) = flxdec->size * 4; - /* decode chunks */ - flx_decode_chunks (flxdec, - ((FlxFrameType *) chunk)->chunks, - GST_BUFFER_DATA (buf) + FlxFrameTypeSize, - GST_BUFFER_DATA (flxdec->frame)); + /* decode chunks */ + flx_decode_chunks (flxdec, + ((FlxFrameType *) chunk)->chunks, + GST_BUFFER_DATA (buf) + FlxFrameTypeSize, + GST_BUFFER_DATA (flxdec->frame)); - /* destroy input buffer */ - gst_buffer_unref (buf); + /* destroy input buffer */ + gst_buffer_unref (buf); - /* save copy of the current frame for possible delta. */ - memcpy (GST_BUFFER_DATA (flxdec->delta), - GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_SIZE (flxdec->delta)); + /* save copy of the current frame for possible delta. */ + memcpy (GST_BUFFER_DATA (flxdec->delta), + GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_SIZE (flxdec->delta)); - /* convert current frame. */ - flx_colorspace_convert (flxdec->converter, - GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_DATA (out)); + /* convert current frame. */ + flx_colorspace_convert (flxdec->converter, + GST_BUFFER_DATA (flxdec->frame), GST_BUFFER_DATA (out)); - GST_BUFFER_TIMESTAMP (out) = flxdec->next_time; - flxdec->next_time += flxdec->frame_time; + GST_BUFFER_TIMESTAMP (out) = flxdec->next_time; + flxdec->next_time += flxdec->frame_time; - gst_pad_push (flxdec->srcpad, GST_DATA (out)); + gst_pad_push (flxdec->srcpad, GST_DATA (out)); - break; + break; } /* destroy header buffer */ diff --git a/gst/mixmatrix/mixmatrix.c b/gst/mixmatrix/mixmatrix.c index f7095e27..d8dd5ca5 100644 --- a/gst/mixmatrix/mixmatrix.c +++ b/gst/mixmatrix/mixmatrix.c @@ -142,9 +142,10 @@ gst_mixmatrix_get_type (void) 0, (GInstanceInitFunc) gst_mixmatrix_init, }; + mixmatrix_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstMixMatrix", - &mixmatrix_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstMixMatrix", + &mixmatrix_info, 0); } return mixmatrix_type; } @@ -181,15 +182,15 @@ gst_mixmatrix_class_init (GstMixMatrixClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SINKPADS, g_param_spec_int ("sinkpads", "Sink Pads", - "Number of sink pads in matrix", 0, G_MAXINT, 8, G_PARAM_READABLE)); + "Number of sink pads in matrix", 0, G_MAXINT, 8, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SRCPADS, g_param_spec_int ("srcpads", "Src Pads", "Number of src pads in matrix", - 0, G_MAXINT, 8, G_PARAM_READABLE)); + 0, G_MAXINT, 8, G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MATRIXPTR, g_param_spec_pointer ("matrixptr", "Matrix Pointer", - "Pointer to gfloat mix matrix", G_PARAM_READABLE)); + "Pointer to gfloat mix matrix", G_PARAM_READABLE)); gobject_class->set_property = gst_mixmatrix_set_property; gobject_class->get_property = gst_mixmatrix_get_property; @@ -271,17 +272,17 @@ mixmatrix_resize (GstMixMatrix * mix, int sinkpads, int srcpads) // check the sinkpads list if (sinkresize) { mix->sinkpads = - (GstPad **) grow_ptrlist ((void **) mix->sinkpads, mix->sinkpadalloc, - sinkpads); + (GstPad **) grow_ptrlist ((void **) mix->sinkpads, mix->sinkpadalloc, + sinkpads); mix->sinkbs = - (GstByteStream **) grow_ptrlist ((void **) mix->sinkbs, - mix->sinkpadalloc, sinkpads); + (GstByteStream **) grow_ptrlist ((void **) mix->sinkbs, + mix->sinkpadalloc, sinkpads); } // check the srcpads list if (srcresize) { mix->srcpads = - (GstPad **) grow_ptrlist ((void **) mix->srcpads, mix->srcpadalloc, - srcpads); + (GstPad **) grow_ptrlist ((void **) mix->srcpads, mix->srcpadalloc, + srcpads); } // now resize the matrix if either has changed if (sinkresize || srcresize) { @@ -293,8 +294,8 @@ mixmatrix_resize (GstMixMatrix * mix, int sinkpads, int srcpads) // otherwise we have to copy line by line } else { for (i = 0; i < mix->srcpadalloc; i++) - memcpy (newmatrix[i], mix->matrix[i], - sizeof (gfloat) * mix->srcpadalloc); + memcpy (newmatrix[i], mix->matrix[i], + sizeof (gfloat) * mix->srcpadalloc); } // would signal here! @@ -343,9 +344,9 @@ gst_mixmatrix_connect (GstPad * pad, const GstCaps * caps) for (i = 0; i < mix->srcpadalloc; i++) { if (mix->srcpads[i]) { if (GST_PAD_CAPS (mix->srcpads[i]) == NULL) { - if (gst_pad_try_set_caps (mix->srcpads[i], caps) <= 0) { - return GST_PAD_LINK_REFUSED; - } + if (gst_pad_try_set_caps (mix->srcpads[i], caps) <= 0) { + return GST_PAD_LINK_REFUSED; + } } } } @@ -377,11 +378,11 @@ gst_mixmatrix_request_new_pad (GstElement * element, GstPadTemplate * templ, // determine if it's bigger than the current size if (padnum >= mix->sinkpadalloc) mixmatrix_resize (mix, ROUND_UP (padnum, mix->grpsize), - mix->sinkpadalloc); + mix->sinkpadalloc); pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&mixmatrix_sink_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&mixmatrix_sink_template), name); GST_PAD_ELEMENT_PRIVATE (pad) = GINT_TO_POINTER (padnum); gst_element_add_pad (GST_ELEMENT (mix), pad); // g_signal_connect(G_OBJECT(pad), "unlink", G_CALLBACK(sink_unlinked), mix); @@ -404,8 +405,8 @@ gst_mixmatrix_request_new_pad (GstElement * element, GstPadTemplate * templ, mixmatrix_resize (mix, ROUND_UP (padnum, mix->grpsize), mix->srcpadalloc); pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&mixmatrix_src_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&mixmatrix_src_template), name); GST_PAD_ELEMENT_PRIVATE (pad) = GINT_TO_POINTER (padnum); gst_element_add_pad (GST_ELEMENT (mix), pad); // g_signal_connect(G_OBJECT(pad), "unlink", G_CALLBACK(sink_unlinked), mix); @@ -450,7 +451,7 @@ gst_mixmatrix_loop (GstElement * element) infloats[i] = (gfloat *) GST_BUFFER_DATA (inbufs[i]); // loop through each src pad for (j = 0; j < mix->srcpadalloc; j++) { - if (mix->srcpads[j] != NULL) { + if (mix->srcpads[j] != NULL) { /* { int z; @@ -461,12 +462,12 @@ gst_mixmatrix_loop (GstElement * element) } fprintf(stderr,"attempting to get gain for %dx%d\n",i,j); */ - gain = mix->matrix[i][j]; + gain = mix->matrix[i][j]; // fprintf(stderr,"%d->%d=%0.2f ",i,j,gain); - for (k = 0; k < mix->outsize; k++) { - outfloats[j][k] += infloats[i][k] * gain; - } - } + for (k = 0; k < mix->outsize; k++) { + outfloats[j][k] += infloats[i][k] * gain; + } + } } } } diff --git a/gst/modplug/gstmodplug.cc b/gst/modplug/gstmodplug.cc index bcd7808c..e69c1c8b 100644 --- a/gst/modplug/gstmodplug.cc +++ b/gst/modplug/gstmodplug.cc @@ -75,9 +75,9 @@ static GstStaticPadTemplate modplug_src_template_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, - GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ - "channels = (int) [ 1, 2 ]; " "audio/x-raw-int, " "signed = (boolean) FALSE, " "width = (int) 8, " "depth = (int) 8, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ - "channels = (int) [ 1, 2 ]") + GST_STATIC_CAPS ("audio/x-raw-int, " "endianness = (int) BYTE_ORDER, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ + "channels = (int) [ 1, 2 ]; " "audio/x-raw-int, " "signed = (boolean) FALSE, " "width = (int) 8, " "depth = (int) 8, " "rate = (int) { 8000, 11025, 22050, 44100 }, " /* FIXME? */ + "channels = (int) [ 1, 2 ]") ); static GstStaticPadTemplate modplug_sink_template_factory = @@ -133,9 +133,10 @@ gst_modplug_get_type (void) (GInstanceInitFunc) gst_modplug_init, NULL }; + modplug_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstModPlug", &modplug_info, - (GTypeFlags) 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstModPlug", &modplug_info, + (GTypeFlags) 0); } return modplug_type; } @@ -165,51 +166,51 @@ gst_modplug_class_init (GstModPlugClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SONGNAME, g_param_spec_string ("songname", "Songname", "The song name", - "", G_PARAM_READABLE)); + "", G_PARAM_READABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_REVERB, g_param_spec_boolean ("reverb", "reverb", "reverb", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_REVERB_DEPTH, g_param_spec_int ("reverb_depth", "reverb_depth", "reverb_depth", - 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_REVERB_DELAY, g_param_spec_int ("reverb_delay", "reverb_delay", "reverb_delay", - 0, 200, 100, (GParamFlags) G_PARAM_READWRITE)); + 0, 200, 100, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEGABASS, g_param_spec_boolean ("megabass", "megabass", "megabass", - FALSE, (GParamFlags) G_PARAM_READWRITE)); + FALSE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEGABASS_AMOUNT, g_param_spec_int ("megabass_amount", "megabass_amount", "megabass_amount", - 0, 100, 40, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 40, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_MEGABASS_RANGE, g_param_spec_int ("megabass_range", "megabass_range", "megabass_range", - 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 30, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SURROUND, g_param_spec_boolean ("surround", "surround", "surround", - TRUE, (GParamFlags) G_PARAM_READWRITE)); + TRUE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SURROUND_DEPTH, g_param_spec_int ("surround_depth", "surround_depth", "surround_depth", - 0, 100, 20, (GParamFlags) G_PARAM_READWRITE)); + 0, 100, 20, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SURROUND_DELAY, g_param_spec_int ("surround_delay", "surround_delay", "surround_delay", - 0, 40, 20, (GParamFlags) G_PARAM_READWRITE)); + 0, 40, 20, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_OVERSAMP, g_param_spec_boolean ("oversamp", "oversamp", "oversamp", - TRUE, (GParamFlags) G_PARAM_READWRITE)); + TRUE, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_NOISE_REDUCTION, g_param_spec_boolean ("noise_reduction", "noise_reduction", - "noise_reduction", TRUE, (GParamFlags) G_PARAM_READWRITE)); + "noise_reduction", TRUE, (GParamFlags) G_PARAM_READWRITE)); gobject_class->set_property = gst_modplug_set_property; gobject_class->get_property = gst_modplug_get_property; @@ -233,8 +234,7 @@ gst_modplug_init (GstModPlug * modplug) gst_pad_set_event_function (modplug->srcpad, (GstPadEventFunction) GST_DEBUG_FUNCPTR (gst_modplug_src_event)); gst_pad_set_query_function (modplug->srcpad, gst_modplug_src_query); - gst_pad_set_query_type_function (modplug->srcpad, - (GstPadQueryTypeFunction) + gst_pad_set_query_type_function (modplug->srcpad, (GstPadQueryTypeFunction) GST_DEBUG_FUNCPTR (gst_modplug_get_query_types)); gst_pad_set_formats_function (modplug->srcpad, (GstPadFormatsFunction) GST_DEBUG_FUNCPTR (gst_modplug_get_formats)); @@ -269,10 +269,10 @@ gst_modplug_setup (GstModPlug * modplug) { if (modplug->_16bit) modplug->mSoundFile->SetWaveConfig (modplug->frequency, 16, - modplug->channel); + modplug->channel); else modplug->mSoundFile->SetWaveConfig (modplug->frequency, 8, - modplug->channel); + modplug->channel); modplug->mSoundFile->SetWaveConfigEx (modplug->surround, !modplug->oversamp, modplug->reverb, true, modplug->megabass, modplug->noise_reduction, true); @@ -280,15 +280,15 @@ gst_modplug_setup (GstModPlug * modplug) if (modplug->surround) modplug->mSoundFile->SetSurroundParameters (modplug->surround_depth, - modplug->surround_delay); + modplug->surround_delay); if (modplug->megabass) modplug->mSoundFile->SetXBassParameters (modplug->megabass_amount, - modplug->megabass_range); + modplug->megabass_range); if (modplug->reverb) modplug->mSoundFile->SetReverbParameters (modplug->reverb_depth, - modplug->reverb_delay); + modplug->reverb_delay); } @@ -336,23 +336,23 @@ gst_modplug_src_query (GstPad * pad, GstQueryType type, switch (type) { case GST_QUERY_TOTAL: switch (*format) { - case GST_FORMAT_TIME: - *value = (gint64) modplug->mSoundFile->GetSongTime () * GST_SECOND; - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *value = (gint64) modplug->mSoundFile->GetSongTime () * GST_SECOND; + break; + default: + res = FALSE; + break; } break; case GST_QUERY_POSITION: switch (*format) { - default: - tmp = - ((float) (modplug->mSoundFile->GetSongTime () * - modplug->mSoundFile->GetCurrentPos ()) / - (float) modplug->mSoundFile->GetMaxPosition ()); - *value = (gint64) (tmp * GST_SECOND); - break; + default: + tmp = + ((float) (modplug->mSoundFile->GetSongTime () * + modplug->mSoundFile->GetCurrentPos ()) / + (float) modplug->mSoundFile->GetMaxPosition ()); + *value = (gint64) (tmp * GST_SECOND); + break; } default: break; @@ -503,10 +503,10 @@ gst_modplug_handle_event (GstModPlug * modplug) break; case GST_EVENT_DISCONTINUOUS: if (gst_event_discont_get_value (event, GST_FORMAT_BYTES, &value)) { - if (remaining == value) { - gst_event_unref (event); - break; - } + if (remaining == value) { + gst_event_unref (event); + break; + } } gst_bytestream_flush_fast (modplug->bs, remaining); default: @@ -568,12 +568,12 @@ gst_modplug_loop (GstElement * element) modplug->song_size = gst_bytestream_length (modplug->bs); got = - gst_bytestream_peek_bytes (modplug->bs, &modplug->buffer_in, - modplug->song_size); + gst_bytestream_peek_bytes (modplug->bs, &modplug->buffer_in, + modplug->song_size); if (got < modplug->song_size) { - gst_modplug_handle_event (modplug); - return; + gst_modplug_handle_event (modplug); + return; } modplug->state = MODPLUG_STATE_LOAD_TUNE; } @@ -583,7 +583,7 @@ gst_modplug_loop (GstElement * element) modplug->mSoundFile = new CSoundFile; if (!GST_PAD_CAPS (modplug->srcpad) && - GST_PAD_LINK_FAILED (gst_pad_renegotiate (modplug->srcpad))) { + GST_PAD_LINK_FAILED (gst_pad_renegotiate (modplug->srcpad))) { GST_ELEMENT_ERROR (modplug, CORE, NEGOTIATION, (NULL), (NULL)); return; } @@ -624,14 +624,14 @@ gst_modplug_loop (GstElement * element) GstFormat format = GST_FORMAT_TIME; if (gst_modplug_src_query (modplug->srcpad, GST_QUERY_POSITION, &format, - &value)) { - discont = - gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, value, - GST_FORMAT_UNDEFINED); - modplug->timestamp = value; + &value)) { + discont = + gst_event_new_discontinuous (FALSE, GST_FORMAT_TIME, value, + GST_FORMAT_UNDEFINED); + modplug->timestamp = value; } else { - modplug->timestamp = GST_CLOCK_TIME_NONE; - discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_UNDEFINED); + modplug->timestamp = GST_CLOCK_TIME_NONE; + discont = gst_event_new_discontinuous (FALSE, GST_FORMAT_UNDEFINED); } gst_pad_push (modplug->srcpad, GST_DATA (discont)); modplug->need_discont = FALSE; @@ -642,19 +642,19 @@ gst_modplug_loop (GstElement * element) buffer_out = gst_buffer_new (); GST_BUFFER_DATA (buffer_out) = - (guchar *) g_memdup (modplug->audiobuffer, modplug->length); + (guchar *) g_memdup (modplug->audiobuffer, modplug->length); GST_BUFFER_SIZE (buffer_out) = modplug->length; GST_BUFFER_TIMESTAMP (buffer_out) = modplug->timestamp; if (GST_CLOCK_TIME_IS_VALID (modplug->timestamp)) { - GST_BUFFER_DURATION (buffer_out) = - modplug->length * GST_SECOND / modplug->frequency / - modplug->channel / (modplug->_16bit ? 2 : 1); - modplug->timestamp += GST_BUFFER_DURATION (buffer_out); + GST_BUFFER_DURATION (buffer_out) = + modplug->length * GST_SECOND / modplug->frequency / + modplug->channel / (modplug->_16bit ? 2 : 1); + modplug->timestamp += GST_BUFFER_DURATION (buffer_out); } if (GST_PAD_IS_USABLE (modplug->srcpad)) - gst_pad_push (modplug->srcpad, GST_DATA (buffer_out)); + gst_pad_push (modplug->srcpad, GST_DATA (buffer_out)); } else if (GST_PAD_IS_LINKED (modplug->srcpad)) { /* FIXME, hack, pull final EOS from peer */ gst_bytestream_flush (modplug->bs, 1); @@ -691,11 +691,11 @@ gst_modplug_change_state (GstElement * element) gst_bytestream_destroy (modplug->bs); modplug->bs = NULL; if (modplug->opened) { - modplug->mSoundFile->Destroy (); - modplug->opened = FALSE; + modplug->mSoundFile->Destroy (); + modplug->opened = FALSE; } if (modplug->audiobuffer) - g_free (modplug->audiobuffer); + g_free (modplug->audiobuffer); modplug->buffer_in = NULL; modplug->audiobuffer = NULL; modplug->state = MODPLUG_STATE_NEED_TUNE; diff --git a/gst/mpeg1sys/buffer.c b/gst/mpeg1sys/buffer.c index ceb67d07..6bfcbc06 100644 --- a/gst/mpeg1sys/buffer.c +++ b/gst/mpeg1sys/buffer.c @@ -139,7 +139,7 @@ mpeg1mux_buffer_queue (Mpeg1MuxBuffer * mb, GstBuffer * buf) } else { mb->buffer = g_realloc (mb->buffer, mb->length + GST_BUFFER_SIZE (buf)); memcpy (mb->buffer + mb->length, GST_BUFFER_DATA (buf), - GST_BUFFER_SIZE (buf)); + GST_BUFFER_SIZE (buf)); mb->length += GST_BUFFER_SIZE (buf); } @@ -169,7 +169,7 @@ mpeg1mux_buffer_update_queued (Mpeg1MuxBuffer * mb, guint64 scr) queued_list = g_list_first (mb->queued_list); } else { GST_DEBUG ("queued in buffer %ld, %" G_GUINT64_FORMAT, - tc->original_length, tc->DTS); + tc->original_length, tc->DTS); total_queued += tc->original_length; queued_list = g_list_next (queued_list); } @@ -208,18 +208,18 @@ mpeg1mux_buffer_shrink (Mpeg1MuxBuffer * mb, gulong size) consumed += tc->length; while (size >= consumed) { GST_DEBUG ("removing timecode: %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT - " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); + " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); mb->timecode_list = g_list_remove_link (mb->timecode_list, timecode_list); mb->queued_list = g_list_append (mb->queued_list, tc); timecode_list = g_list_first (mb->timecode_list); tc = (Mpeg1MuxTimecode *) timecode_list->data; consumed += tc->length; GST_DEBUG ("next timecode: %" G_GUINT64_FORMAT " %" G_GUINT64_FORMAT - " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); + " %lu %lu", tc->DTS, tc->PTS, tc->length, consumed); } mb->new_frame = TRUE; GST_DEBUG ("leftover frame size from %lu to %lu ", tc->length, - consumed - size); + consumed - size); tc->length = consumed - size; } @@ -275,17 +275,17 @@ mpeg1mux_buffer_update_video_info (Mpeg1MuxBuffer * mb) mb->info.video.picture_rate = gst_getbits4 (&gb); mb->info.video.bit_rate = gst_getbits18 (&gb); if (gst_getbits1 (&gb) != 1) { - g_print ("mpeg1mux::update_video_info: marker bit error\n"); + g_print ("mpeg1mux::update_video_info: marker bit error\n"); } mb->info.video.vbv_buffer_size = gst_getbits10 (&gb); mb->info.video.CSPF = gst_getbits1 (&gb); mb->info.video.secs_per_frame = - 1. / picture_rates[mb->info.video.picture_rate]; + 1. / picture_rates[mb->info.video.picture_rate]; mb->info.video.decoding_order = 0; mb->info.video.group_order = 0; GST_DEBUG ("mpeg1mux::update_video_info: secs per frame %g", - mb->info.video.secs_per_frame); + mb->info.video.secs_per_frame); } else { g_print ("mpeg1mux::update_video_info: Invalid MPEG Video header\n"); } @@ -298,82 +298,82 @@ mpeg1mux_buffer_update_video_info (Mpeg1MuxBuffer * mb) offset++; /* if it's zero, increment the zero count */ if (byte == 0) { - sync_zeros++; - /*GST_DEBUG ("mpeg1mux::update_video_info: found zero #%d at %lu",sync_zeros,offset-1); */ + sync_zeros++; + /*GST_DEBUG ("mpeg1mux::update_video_info: found zero #%d at %lu",sync_zeros,offset-1); */ } /* if it's a one and we have two previous zeros, we have sync */ else if ((byte == 1) && (sync_zeros >= 2)) { - GST_DEBUG ("mpeg1mux::update_video_info: synced at %lu", offset - 1); - have_sync = TRUE; - sync_zeros = 0; + GST_DEBUG ("mpeg1mux::update_video_info: synced at %lu", offset - 1); + have_sync = TRUE; + sync_zeros = 0; } /* if it's anything else, we've lost it completely */ else - sync_zeros = 0; + sync_zeros = 0; /* then snag the chunk ID */ } else if (id == 0) { id = *(data + offset); GST_DEBUG ("mpeg1mux::update_video_info: got id 0x%02lX", id); id = (SYNCWORD_START << 8) + id; switch (id) { - case SEQUENCE_HEADER: - GST_DEBUG ("mpeg1mux::update_video_info: sequence header"); - break; - case GROUP_START: - GST_DEBUG ("mpeg1mux::update_video_info: group start"); - mb->info.video.group_order = 0; - break; - case PICTURE_START: - /* skip the first access unit */ - if (mb->info.video.decoding_order != 0) { - Mpeg1MuxTimecode *tc; - - GST_DEBUG ("mpeg1mux::update_video_info: PTS %" G_GUINT64_FORMAT - ", DTS %" G_GUINT64_FORMAT ", length %lu", - mb->info.video.current_PTS, mb->info.video.current_DTS, - offset - mb->current_start - 3); - - tc = (Mpeg1MuxTimecode *) g_malloc (sizeof (Mpeg1MuxTimecode)); - tc->length = offset - mb->current_start - 3; - tc->original_length = tc->length; - tc->frame_type = mb->info.video.current_type; - tc->DTS = mb->info.video.current_DTS; - tc->PTS = mb->info.video.current_PTS; - - mb->timecode_list = g_list_append (mb->timecode_list, tc); - - if (mb->info.video.decoding_order == 0) { - mb->next_frame_time = tc->DTS; - } - - mb->current_start = offset - 3; - } - - temp = (*(data + offset + 1) << 8) + *(data + offset + 2); - temporal_reference = (temp & 0xffc0) >> 6; - mb->info.video.current_type = (temp & 0x0038) >> 3; - GST_DEBUG - ("mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame", - temporal_reference, - picture_types[mb->info.video.current_type - 1]); - - mb->info.video.current_DTS = - mb->info.video.decoding_order * mb->info.video.secs_per_frame * - CLOCKS; - mb->info.video.current_PTS = - (temporal_reference - mb->info.video.group_order + 1 + - mb->info.video.decoding_order) * mb->info.video.secs_per_frame * - CLOCKS; - - mb->info.video.decoding_order++; - mb->info.video.group_order++; - - - offset++; - break; - case SEQUENCE_END: - GST_DEBUG ("mpeg1mux::update_video_info: sequence end"); - break; + case SEQUENCE_HEADER: + GST_DEBUG ("mpeg1mux::update_video_info: sequence header"); + break; + case GROUP_START: + GST_DEBUG ("mpeg1mux::update_video_info: group start"); + mb->info.video.group_order = 0; + break; + case PICTURE_START: + /* skip the first access unit */ + if (mb->info.video.decoding_order != 0) { + Mpeg1MuxTimecode *tc; + + GST_DEBUG ("mpeg1mux::update_video_info: PTS %" G_GUINT64_FORMAT + ", DTS %" G_GUINT64_FORMAT ", length %lu", + mb->info.video.current_PTS, mb->info.video.current_DTS, + offset - mb->current_start - 3); + + tc = (Mpeg1MuxTimecode *) g_malloc (sizeof (Mpeg1MuxTimecode)); + tc->length = offset - mb->current_start - 3; + tc->original_length = tc->length; + tc->frame_type = mb->info.video.current_type; + tc->DTS = mb->info.video.current_DTS; + tc->PTS = mb->info.video.current_PTS; + + mb->timecode_list = g_list_append (mb->timecode_list, tc); + + if (mb->info.video.decoding_order == 0) { + mb->next_frame_time = tc->DTS; + } + + mb->current_start = offset - 3; + } + + temp = (*(data + offset + 1) << 8) + *(data + offset + 2); + temporal_reference = (temp & 0xffc0) >> 6; + mb->info.video.current_type = (temp & 0x0038) >> 3; + GST_DEBUG + ("mpeg1mux::update_video_info: picture start temporal_ref:%d type:%s Frame", + temporal_reference, + picture_types[mb->info.video.current_type - 1]); + + mb->info.video.current_DTS = + mb->info.video.decoding_order * mb->info.video.secs_per_frame * + CLOCKS; + mb->info.video.current_PTS = + (temporal_reference - mb->info.video.group_order + 1 + + mb->info.video.decoding_order) * mb->info.video.secs_per_frame * + CLOCKS; + + mb->info.video.decoding_order++; + mb->info.video.group_order++; + + + offset++; + break; + case SEQUENCE_END: + GST_DEBUG ("mpeg1mux::update_video_info: sequence end"); + break; } /* prepare for next sync */ offset++; @@ -411,30 +411,30 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->info.audio.layer = 4 - layer_index; lsf = (id & (1 << 20)) ? ((id & (1 << 19)) ? 0 : 1) : 1; mb->info.audio.bit_rate = - bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; + bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; samplerate_index = (id >> 10) & 0x3; padding = (id >> 9) & 0x1; if (mb->info.audio.layer == 1) { - bpf = mb->info.audio.bit_rate * 12000; - bpf /= frequency[samplerate_index]; - bpf = ((bpf + padding) << 2); + bpf = mb->info.audio.bit_rate * 12000; + bpf /= frequency[samplerate_index]; + bpf = ((bpf + padding) << 2); } else { - bpf = mb->info.audio.bit_rate * 144000; - bpf /= frequency[samplerate_index]; - bpf += padding; + bpf = mb->info.audio.bit_rate * 144000; + bpf /= frequency[samplerate_index]; + bpf += padding; } mb->info.audio.framesize = bpf; GST_DEBUG ("mpeg1mux::update_audio_info: samples per second %d", - samplerate_index); + samplerate_index); gst_getbits_init (&gb, NULL, NULL); gst_getbits_newbuf (&gb, data, mb->length); gst_flushbitsn (&gb, 12); if (gst_getbits1 (&gb) != 1) { - g_print ("mpeg1mux::update_audio_info: marker bit error\n"); + g_print ("mpeg1mux::update_audio_info: marker bit error\n"); } gst_flushbitsn (&gb, 2); mb->info.audio.protection = gst_getbits1 (&gb); @@ -450,15 +450,15 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) GST_DEBUG ("mpeg1mux::update_audio_info: layer %d", mb->info.audio.layer); GST_DEBUG ("mpeg1mux::update_audio_info: bit_rate %d", - mb->info.audio.bit_rate); + mb->info.audio.bit_rate); GST_DEBUG ("mpeg1mux::update_audio_info: frequency %d", - mb->info.audio.frequency); + mb->info.audio.frequency); mb->info.audio.samples_per_second = - (double) dfrequency[mb->info.audio.frequency]; + (double) dfrequency[mb->info.audio.frequency]; GST_DEBUG ("mpeg1mux::update_audio_info: samples per second %g", - mb->info.audio.samples_per_second); + mb->info.audio.samples_per_second); mb->info.audio.decoding_order = 0; @@ -468,11 +468,11 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) tc->frame_type = FRAME_TYPE_AUDIO; mb->info.audio.current_PTS = - mb->info.audio.decoding_order * samples[mb->info.audio.layer] / - mb->info.audio.samples_per_second * 90. + startup_delay; + mb->info.audio.decoding_order * samples[mb->info.audio.layer] / + mb->info.audio.samples_per_second * 90. + startup_delay; GST_DEBUG ("mpeg1mux::update_audio_info: PTS %" G_GUINT64_FORMAT - ", length %u", mb->info.audio.current_PTS, mb->info.audio.framesize); + ", length %u", mb->info.audio.current_PTS, mb->info.audio.framesize); tc->PTS = mb->info.audio.current_PTS; tc->DTS = mb->info.audio.current_PTS; mb->timecode_list = g_list_append (mb->timecode_list, tc); @@ -493,7 +493,7 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->info.audio.layer = 4 - layer_index; lsf = (id & (1 << 20)) ? ((id & (1 << 19)) ? 0 : 1) : 1; mb->info.audio.bit_rate = - bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; + bitrate_index[lsf][mb->info.audio.layer - 1][((id >> 12) & 0xf)]; samplerate_index = (id >> 10) & 0x3; padding = (id >> 9) & 0x1; @@ -514,16 +514,16 @@ mpeg1mux_buffer_update_audio_info (Mpeg1MuxBuffer * mb) mb->current_start = offset + bpf; mb->info.audio.samples_per_second = - (double) dfrequency[mb->info.audio.frequency]; + (double) dfrequency[mb->info.audio.frequency]; mb->info.audio.current_PTS = - (mb->info.audio.decoding_order * samples[mb->info.audio.layer]) / - mb->info.audio.samples_per_second * 90.; + (mb->info.audio.decoding_order * samples[mb->info.audio.layer]) / + mb->info.audio.samples_per_second * 90.; tc->DTS = tc->PTS = mb->info.audio.current_PTS; GST_DEBUG ("mpeg1mux::update_audio_info: PTS %" G_GUINT64_FORMAT ", %" - G_GUINT64_FORMAT " length %lu", mb->info.audio.current_PTS, tc->PTS, - tc->length); + G_GUINT64_FORMAT " length %lu", mb->info.audio.current_PTS, tc->PTS, + tc->length); mb->timecode_list = g_list_append (mb->timecode_list, tc); mb->info.audio.decoding_order++; diff --git a/gst/mpeg1sys/gstmpeg1systemencode.c b/gst/mpeg1sys/gstmpeg1systemencode.c index a071f0c4..c8698430 100644 --- a/gst/mpeg1sys/gstmpeg1systemencode.c +++ b/gst/mpeg1sys/gstmpeg1systemencode.c @@ -61,7 +61,7 @@ GST_STATIC_PAD_TEMPLATE ("video_%d", GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) 1, " "systemstream = (boolean) FALSE") + "mpegversion = (int) 1, " "systemstream = (boolean) FALSE") ); static GstStaticPadTemplate audio_sink_factory = @@ -69,7 +69,7 @@ GST_STATIC_PAD_TEMPLATE ("audio_%d", GST_PAD_SINK, GST_PAD_REQUEST, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " "layer = (int) [ 1, 2 ] ") + "mpegversion = (int) 1, " "layer = (int) [ 1, 2 ] ") ); static void gst_system_encode_class_init (GstMPEG1SystemEncodeClass * klass); @@ -107,9 +107,10 @@ gst_mpeg1_system_encode_get_type (void) (GInstanceInitFunc) gst_system_encode_init, NULL }; + system_encode_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstMPEG1SystemEncode", - &system_encode_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstMPEG1SystemEncode", + &system_encode_info, 0); } return system_encode_type; } @@ -194,7 +195,7 @@ gst_system_encode_request_new_pad (GstElement * element, GstPadTemplate * templ, g_print ("%s\n", name); newpad = gst_pad_new_from_template (templ, name); gst_pad_set_element_private (newpad, - GINT_TO_POINTER (system_encode->num_audio_pads)); + GINT_TO_POINTER (system_encode->num_audio_pads)); system_encode->audio_pad[system_encode->num_audio_pads] = newpad; system_encode->num_audio_pads++; @@ -204,7 +205,7 @@ gst_system_encode_request_new_pad (GstElement * element, GstPadTemplate * templ, g_print ("%s\n", name); newpad = gst_pad_new_from_template (templ, name); gst_pad_set_element_private (newpad, - GINT_TO_POINTER (system_encode->num_video_pads)); + GINT_TO_POINTER (system_encode->num_video_pads)); system_encode->video_pad[system_encode->num_video_pads] = newpad; system_encode->num_video_pads++; @@ -233,13 +234,13 @@ gst_system_encode_pick_streams (GList * mta, if (system_encode->which_streams & STREAMS_VIDEO) { if (system_encode->video_buffer->next_frame_time < - lowest - system_encode->video_delay) { + lowest - system_encode->video_delay) { lowest = system_encode->video_buffer->next_frame_time; } } if (system_encode->which_streams & STREAMS_AUDIO) { if (system_encode->audio_buffer->next_frame_time < - lowest - system_encode->audio_delay) { + lowest - system_encode->audio_delay) { lowest = system_encode->audio_buffer->next_frame_time; } } @@ -263,25 +264,25 @@ gst_system_encode_have_data (GstMPEG1SystemEncode * system_encode) if (system_encode->which_streams == (STREAMS_VIDEO | STREAMS_AUDIO)) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->audio_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > - system_encode->packet_size * 2 - && MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 - && MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > + system_encode->packet_size * 2 + && MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 + && MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > + system_encode->packet_size * 2) { return TRUE; } } if (system_encode->which_streams == STREAMS_VIDEO) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->video_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->video_buffer) > + system_encode->packet_size * 2) { return TRUE; } } if (system_encode->which_streams == STREAMS_VIDEO) { if (MPEG1MUX_BUFFER_QUEUED (system_encode->audio_buffer) > 2 && - MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > - system_encode->packet_size * 2) { + MPEG1MUX_BUFFER_SPACE (system_encode->audio_buffer) > + system_encode->packet_size * 2) { return TRUE; } } @@ -321,12 +322,12 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->which_streams & STREAMS_VIDEO) { system_encode->video_rate = - system_encode->video_buffer->info.video.bit_rate * 50; + system_encode->video_buffer->info.video.bit_rate * 50; } else system_encode->video_rate = 0; if (system_encode->which_streams & STREAMS_AUDIO) system_encode->audio_rate = - system_encode->audio_buffer->info.audio.bit_rate * 128; + system_encode->audio_buffer->info.audio.bit_rate * 128; else system_encode->audio_rate = 0; @@ -335,11 +336,11 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) system_encode->dmux_rate = ceil ((double) (system_encode->data_rate) * ((double) (system_encode->packet_size) / - (double) (system_encode->min_packet_data) + - ((double) (system_encode->packet_size) / - (double) (system_encode->max_packet_data) * - (double) (system_encode->packets_per_pack - - 1.))) / (double) (system_encode->packets_per_pack)); + (double) (system_encode->min_packet_data) + + ((double) (system_encode->packet_size) / + (double) (system_encode->max_packet_data) * + (double) (system_encode->packets_per_pack - + 1.))) / (double) (system_encode->packets_per_pack)); system_encode->data_rate = ceil (system_encode->dmux_rate / 50.) * 50; GST_DEBUG @@ -363,9 +364,9 @@ gst_system_setup_multiplex (GstMPEG1SystemEncode * system_encode) system_encode->delay = ((double) system_encode->sectors_delay + ceil ((double) video_tc->length / - (double) system_encode->min_packet_data) + + (double) system_encode->min_packet_data) + ceil ((double) video_tc->length / - (double) system_encode->min_packet_data)) * + (double) system_encode->min_packet_data)) * (double) system_encode->packet_size / system_encode->dmux_rate * (double) CLOCKS; @@ -406,15 +407,15 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->mta == NULL) { system_encode->mta = - gst_system_encode_pick_streams (system_encode->mta, system_encode); + gst_system_encode_pick_streams (system_encode->mta, system_encode); } if (system_encode->mta == NULL) break; system_encode->SCR = - (guint64) (system_encode->bytes_output + - LAST_SCR_BYTE_IN_PACK) * CLOCKS / system_encode->dmux_rate; + (guint64) (system_encode->bytes_output + + LAST_SCR_BYTE_IN_PACK) * CLOCKS / system_encode->dmux_rate; streams = g_list_first (system_encode->mta); @@ -422,11 +423,11 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (system_encode->current_pack == system_encode->packets_per_pack) { create_pack (system_encode->pack, system_encode->SCR, - system_encode->mux_rate); + system_encode->mux_rate); create_sys_header (system_encode->sys_header, system_encode->mux_rate, 1, - 1, 1, 1, 1, 1, AUDIO_STR_0, 0, system_encode->audio_buffer_size / 128, - VIDEO_STR_0, 1, system_encode->video_buffer_size / 1024, - system_encode->which_streams); + 1, 1, 1, 1, 1, AUDIO_STR_0, 0, system_encode->audio_buffer_size / 128, + VIDEO_STR_0, 1, system_encode->video_buffer_size / 1024, + system_encode->which_streams); system_encode->current_pack = 0; pack = system_encode->pack; sys_header = system_encode->sys_header; @@ -440,11 +441,11 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (mb->new_frame) { GST_DEBUG ("system_encode::multiplex: new frame"); if (tc->frame_type == FRAME_TYPE_AUDIO - || tc->frame_type == FRAME_TYPE_IFRAME - || tc->frame_type == FRAME_TYPE_PFRAME) { - timestamps = TIMESTAMPS_PTS; + || tc->frame_type == FRAME_TYPE_IFRAME + || tc->frame_type == FRAME_TYPE_PFRAME) { + timestamps = TIMESTAMPS_PTS; } else { - timestamps = TIMESTAMPS_PTS_DTS; + timestamps = TIMESTAMPS_PTS_DTS; } } else { timestamps = TIMESTAMPS_NO; @@ -452,7 +453,7 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) if (tc->frame_type != FRAME_TYPE_AUDIO) { if (tc->PTS < system_encode->startup_delay) - system_encode->startup_delay = tc->PTS; + system_encode->startup_delay = tc->PTS; } if (tc->frame_type == FRAME_TYPE_AUDIO) { @@ -475,27 +476,27 @@ gst_system_encode_multiplex (GstMPEG1SystemEncode * system_encode) /* write the pack/packet here */ create_sector (system_encode->sector, pack, sys_header, - system_encode->packet_size, - MPEG1MUX_BUFFER_DATA (mb), mb->stream_id, buffer_scale, - buffer_size, TRUE, PTS, DTS, - timestamps, system_encode->which_streams); + system_encode->packet_size, + MPEG1MUX_BUFFER_DATA (mb), mb->stream_id, buffer_scale, + buffer_size, TRUE, PTS, DTS, + timestamps, system_encode->which_streams); /* update mta */ system_encode->mta = - gst_system_encode_update_mta (system_encode, system_encode->mta, - system_encode->sector->length_of_packet_data); + gst_system_encode_update_mta (system_encode, system_encode->mta, + system_encode->sector->length_of_packet_data); } else { /* write a padding packet */ create_sector (system_encode->sector, pack, sys_header, - system_encode->packet_size, NULL, PADDING_STR, 0, - 0, FALSE, 0, 0, TIMESTAMPS_NO, system_encode->which_streams); + system_encode->packet_size, NULL, PADDING_STR, 0, + 0, FALSE, 0, 0, TIMESTAMPS_NO, system_encode->which_streams); } outbuf = gst_buffer_new (); GST_BUFFER_DATA (outbuf) = - g_malloc (system_encode->sector->length_of_sector); + g_malloc (system_encode->sector->length_of_sector); GST_BUFFER_SIZE (outbuf) = system_encode->sector->length_of_sector; memcpy (GST_BUFFER_DATA (outbuf), system_encode->sector->buf, - system_encode->sector->length_of_sector); + system_encode->sector->length_of_sector); system_encode->bytes_output += GST_BUFFER_SIZE (outbuf); gst_pad_push (system_encode->srcpad, GST_DATA (outbuf)); @@ -535,15 +536,15 @@ gst_system_encode_chain (GstPad * pad, GstData * _data) if (strncmp (padname, "audio_", 6) == 0) { channel = atoi (&padname[6]); GST_DEBUG - ("gst_system_encode_chain: got audio buffer in from audio channel %02d", - channel); + ("gst_system_encode_chain: got audio buffer in from audio channel %02d", + channel); mpeg1mux_buffer_queue (system_encode->audio_buffer, buf); } else if (strncmp (padname, "video_", 6) == 0) { channel = atoi (&padname[6]); GST_DEBUG - ("gst_system_encode_chain: got video buffer in from video channel %02d", - channel); + ("gst_system_encode_chain: got video buffer in from video channel %02d", + channel); mpeg1mux_buffer_queue (system_encode->video_buffer, buf); diff --git a/gst/mpeg1sys/systems.c b/gst/mpeg1sys/systems.c index 20e7bd90..c0541c5b 100644 --- a/gst/mpeg1sys/systems.c +++ b/gst/mpeg1sys/systems.c @@ -124,7 +124,7 @@ create_sector (sector, pack, sys_header, if (buffers) { *(index++) = (unsigned char) (0x40 | - (buffer_scale << 5) | (buffer_size >> 8)); + (buffer_scale << 5) | (buffer_size >> 8)); *(index++) = (unsigned char) (buffer_size & 0xff); } @@ -164,9 +164,9 @@ create_sector (sector, pack, sys_header, if (tmp != i) { packet_size -= (i - tmp); *(size_offset++) = - (unsigned char) ((packet_size - PACKET_HEADER_SIZE) >> 8); + (unsigned char) ((packet_size - PACKET_HEADER_SIZE) >> 8); *(size_offset++) = - (unsigned char) ((packet_size - PACKET_HEADER_SIZE) & 0xff); + (unsigned char) ((packet_size - PACKET_HEADER_SIZE) & 0xff); /* zero byte stuffing in the last Packet of a stream */ /* we don't need this any more, since we shortenend the packet */ @@ -281,14 +281,14 @@ create_sys_header (sys_header, rate_bound, audio_bound, if (which_streams & STREAMS_AUDIO) { *(index++) = stream1; *(index++) = (unsigned char) (0xc0 | - (buffer1_scale << 5) | (buffer1_size >> 8)); + (buffer1_scale << 5) | (buffer1_size >> 8)); *(index++) = (unsigned char) (buffer1_size & 0xff); } if (which_streams & STREAMS_VIDEO) { *(index++) = stream2; *(index++) = (unsigned char) (0xc0 | - (buffer2_scale << 5) | (buffer2_size >> 8)); + (buffer2_scale << 5) | (buffer2_size >> 8)); *(index++) = (unsigned char) (buffer2_size & 0xff); } diff --git a/gst/mpeg1videoparse/gstmp1videoparse.c b/gst/mpeg1videoparse/gstmp1videoparse.c index e1b5b089..6c666274 100644 --- a/gst/mpeg1videoparse/gstmp1videoparse.c +++ b/gst/mpeg1videoparse/gstmp1videoparse.c @@ -46,19 +46,19 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) 1, " - "systemstream = (boolean) false, " - "width = (int) [ 16, 4096 ], " - "height = (int) [ 16, 4096 ], " - "pixel_width = (int) [ 1, 255 ], " - "pixel_height = (int) [ 1, 255 ], " "framerate = (double) [ 0, MAX ]") + "mpegversion = (int) 1, " + "systemstream = (boolean) false, " + "width = (int) [ 16, 4096 ], " + "height = (int) [ 16, 4096 ], " + "pixel_width = (int) [ 1, 255 ], " + "pixel_height = (int) [ 1, 255 ], " "framerate = (double) [ 0, MAX ]") ); static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS ("video/mpeg, " - "mpegversion = (int) 1, " "systemstream = (boolean) false") + "mpegversion = (int) 1, " "systemstream = (boolean) false") ); /* Mp1VideoParse signals and args */ @@ -106,9 +106,10 @@ mp1videoparse_get_type (void) 0, (GInstanceInitFunc) gst_mp1videoparse_init, }; + mp1videoparse_type = - g_type_register_static (GST_TYPE_ELEMENT, "Mp1VideoParse", - &mp1videoparse_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "Mp1VideoParse", + &mp1videoparse_info, 0); } return mp1videoparse_type; } @@ -181,9 +182,9 @@ mp1videoparse_parse_seq (Mp1VideoParse * mp1videoparse, GstBuffer * buf) fps_idx = (n & 0x0000000f) >> 0; if (fps_idx >= 9 || fps_idx <= 0) - fps_idx = 3; /* well, we need a default */ + fps_idx = 3; /* well, we need a default */ if (asr_idx >= 15 || asr_idx <= 0) - asr_idx = 1; /* no aspect ratio */ + asr_idx = 1; /* no aspect ratio */ if (asr_table[asr_idx] != mp1videoparse->asr || fps_table[fps_idx] != mp1videoparse->fps || @@ -200,12 +201,12 @@ mp1videoparse_parse_seq (Mp1VideoParse * mp1videoparse, GstBuffer * buf) p_h = (asr_table[asr_idx] > 1.0) ? (100 * asr_table[asr_idx]) : 1; caps = gst_caps_new_simple ("video/mpeg", - "systemstream", G_TYPE_BOOLEAN, FALSE, - "mpegversion", G_TYPE_INT, 1, - "width", G_TYPE_INT, width, - "height", G_TYPE_INT, height, - "framerate", G_TYPE_DOUBLE, fps_table[fps_idx], - "pixel_width", G_TYPE_INT, p_w, "pixel_height", G_TYPE_INT, p_h, NULL); + "systemstream", G_TYPE_BOOLEAN, FALSE, + "mpegversion", G_TYPE_INT, 1, + "width", G_TYPE_INT, width, + "height", G_TYPE_INT, height, + "framerate", G_TYPE_DOUBLE, fps_table[fps_idx], + "pixel_width", G_TYPE_INT, p_w, "pixel_height", G_TYPE_INT, p_h, NULL); GST_DEBUG ("New mpeg1videoparse caps: " GST_PTR_FORMAT, caps); @@ -220,7 +221,7 @@ mp1videoparse_valid_sync (Mp1VideoParse * mp1videoparse, guint32 head, switch (head) { case SEQ_START_CODE:{ GstBuffer *subbuf = gst_buffer_create_sub (buf, 4, - GST_BUFFER_SIZE (buf) - 4); + GST_BUFFER_SIZE (buf) - 4); mp1videoparse_parse_seq (mp1videoparse, subbuf); gst_buffer_unref (subbuf); @@ -233,7 +234,7 @@ mp1videoparse_valid_sync (Mp1VideoParse * mp1videoparse, guint32 head, return TRUE; default: if (head >= SLICE_MIN_START_CODE && head <= SLICE_MAX_START_CODE) - return TRUE; + return TRUE; } return FALSE; @@ -259,10 +260,10 @@ mp1videoparse_find_next_gop (Mp1VideoParse * mp1videoparse, GstBuffer * buf) have_sync = TRUE; } else if (have_sync) { if (byte == (SEQ_START_CODE & 0xff) || byte == (GOP_START_CODE & 0xff)) { - return offset - 4; + return offset - 4; } else { - sync_zeros = 0; - have_sync = FALSE; + sync_zeros = 0; + have_sync = FALSE; } } else { sync_zeros = 0; @@ -277,10 +278,10 @@ gst_mp1videoparse_time_code (guchar * gop, gfloat fps) { guint32 data = GUINT32_FROM_BE (*(guint32 *) gop); - return ((((data & 0xfc000000) >> 26) * 3600 * GST_SECOND) + /* hours */ - (((data & 0x03f00000) >> 20) * 60 * GST_SECOND) + /* minutes */ - (((data & 0x0007e000) >> 13) * GST_SECOND) + /* seconds */ - (((data & 0x00001f80) >> 7) * GST_SECOND / fps)); /* frames */ + return ((((data & 0xfc000000) >> 26) * 3600 * GST_SECOND) + /* hours */ + (((data & 0x03f00000) >> 20) * 60 * GST_SECOND) + /* minutes */ + (((data & 0x0007e000) >> 13) * GST_SECOND) + /* seconds */ + (((data & 0x00001f80) >> 7) * GST_SECOND / fps)); /* frames */ } static void @@ -334,17 +335,17 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, switch (GST_EVENT_TYPE (event)) { case GST_EVENT_FLUSH: case GST_EVENT_DISCONTINUOUS: - gst_mp1videoparse_flush (mp1videoparse); - break; + gst_mp1videoparse_flush (mp1videoparse); + break; case GST_EVENT_EOS: - gst_mp1videoparse_flush (mp1videoparse); - gst_event_ref (event); - gst_pad_push (outpad, GST_DATA (event)); - gst_element_set_eos (GST_ELEMENT (mp1videoparse)); - break; + gst_mp1videoparse_flush (mp1videoparse); + gst_event_ref (event); + gst_pad_push (outpad, GST_DATA (event)); + gst_element_set_eos (GST_ELEMENT (mp1videoparse)); + break; default: - GST_DEBUG ("Unhandled event type %d", GST_EVENT_TYPE (event)); - break; + GST_DEBUG ("Unhandled event type %d", GST_EVENT_TYPE (event)); + break; } gst_event_unref (event); @@ -382,43 +383,43 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, GST_DEBUG ("mp1videoparse: head is %08x", (unsigned int) head); if (!mp1videoparse_valid_sync (mp1videoparse, head, - mp1videoparse->partialbuf) || mp1videoparse->need_resync) { + mp1videoparse->partialbuf) || mp1videoparse->need_resync) { sync_pos = - mp1videoparse_find_next_gop (mp1videoparse, - mp1videoparse->partialbuf); + mp1videoparse_find_next_gop (mp1videoparse, + mp1videoparse->partialbuf); if (sync_pos >= 0) { - mp1videoparse->need_resync = FALSE; - GST_DEBUG ("mp1videoparse: found new gop at %d", sync_pos); - - if (sync_pos != 0) { - temp = - gst_buffer_create_sub (mp1videoparse->partialbuf, sync_pos, - size - sync_pos); - g_assert (temp != NULL); - gst_buffer_unref (mp1videoparse->partialbuf); - mp1videoparse->partialbuf = temp; - data = GST_BUFFER_DATA (mp1videoparse->partialbuf); - size = GST_BUFFER_SIZE (mp1videoparse->partialbuf); - offset = 0; - } - - head = GUINT32_FROM_BE (*((guint32 *) data)); - /* re-call this function so that if we hadn't already, we can - * now read the sequence header and parse video properties, - * set caps, stream data, be happy, bla, bla, bla... */ - if (!mp1videoparse_valid_sync (mp1videoparse, head, - mp1videoparse->partialbuf)) - g_error ("Found sync but no valid sync point at pos 0x0"); + mp1videoparse->need_resync = FALSE; + GST_DEBUG ("mp1videoparse: found new gop at %d", sync_pos); + + if (sync_pos != 0) { + temp = + gst_buffer_create_sub (mp1videoparse->partialbuf, sync_pos, + size - sync_pos); + g_assert (temp != NULL); + gst_buffer_unref (mp1videoparse->partialbuf); + mp1videoparse->partialbuf = temp; + data = GST_BUFFER_DATA (mp1videoparse->partialbuf); + size = GST_BUFFER_SIZE (mp1videoparse->partialbuf); + offset = 0; + } + + head = GUINT32_FROM_BE (*((guint32 *) data)); + /* re-call this function so that if we hadn't already, we can + * now read the sequence header and parse video properties, + * set caps, stream data, be happy, bla, bla, bla... */ + if (!mp1videoparse_valid_sync (mp1videoparse, head, + mp1videoparse->partialbuf)) + g_error ("Found sync but no valid sync point at pos 0x0"); } else { - GST_DEBUG ("mp1videoparse: could not sync"); - gst_buffer_unref (mp1videoparse->partialbuf); - mp1videoparse->partialbuf = NULL; - return; + GST_DEBUG ("mp1videoparse: could not sync"); + gst_buffer_unref (mp1videoparse->partialbuf); + mp1videoparse->partialbuf = NULL; + return; } } if (mp1videoparse->picture_in_buffer == 1 && - time_stamp != GST_CLOCK_TIME_NONE) { + time_stamp != GST_CLOCK_TIME_NONE) { mp1videoparse->last_pts = time_stamp; } @@ -430,56 +431,56 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, while (offset < size - 1) { sync_byte = *(data + offset); if (sync_byte == 0) { - sync_state++; + sync_state++; } else if ((sync_byte == 1) && (sync_state >= 2)) { - GST_DEBUG ("mp1videoparse: code 0x000001%02x", data[offset + 1]); - if (data[offset + 1] == (PICTURE_START_CODE & 0xff)) { - mp1videoparse->picture_in_buffer++; - if (mp1videoparse->picture_in_buffer == 1) { - if (time_stamp != GST_CLOCK_TIME_NONE) { - mp1videoparse->last_pts = time_stamp; - } - sync_state = 0; - } else if (mp1videoparse->picture_in_buffer == 2) { - have_sync = TRUE; - break; - } else { - GST_DEBUG ("mp1videoparse: %d in buffer", - mp1videoparse->picture_in_buffer); - g_assert_not_reached (); - } - } - /* A new sequence (or GOP) is a valid sync too. Note that the - * sequence header should be put in the next buffer, not here. */ - else if (data[offset + 1] == (SEQ_START_CODE & 0xFF) || - data[offset + 1] == (GOP_START_CODE & 0xFF)) { - if (mp1videoparse->picture_in_buffer == 0 && - data[offset + 1] == (GOP_START_CODE & 0xFF)) { - mp1videoparse->last_pts = gst_mp1videoparse_time_code (&data[2], - mp1videoparse->fps); - } else if (mp1videoparse->picture_in_buffer == 1) { - have_sync = TRUE; - break; - } else { - g_assert (mp1videoparse->picture_in_buffer == 0); - } - } - /* end-of-sequence is a valid sync point and should be included - * in the current picture, not the next. */ - else if (data[offset + 1] == (SEQ_END_CODE & 0xFF)) { - if (mp1videoparse->picture_in_buffer == 1) { - offset += 4; - have_sync = TRUE; - break; - } else { - g_assert (mp1videoparse->picture_in_buffer == 0); - } - } else - sync_state = 0; + GST_DEBUG ("mp1videoparse: code 0x000001%02x", data[offset + 1]); + if (data[offset + 1] == (PICTURE_START_CODE & 0xff)) { + mp1videoparse->picture_in_buffer++; + if (mp1videoparse->picture_in_buffer == 1) { + if (time_stamp != GST_CLOCK_TIME_NONE) { + mp1videoparse->last_pts = time_stamp; + } + sync_state = 0; + } else if (mp1videoparse->picture_in_buffer == 2) { + have_sync = TRUE; + break; + } else { + GST_DEBUG ("mp1videoparse: %d in buffer", + mp1videoparse->picture_in_buffer); + g_assert_not_reached (); + } + } + /* A new sequence (or GOP) is a valid sync too. Note that the + * sequence header should be put in the next buffer, not here. */ + else if (data[offset + 1] == (SEQ_START_CODE & 0xFF) || + data[offset + 1] == (GOP_START_CODE & 0xFF)) { + if (mp1videoparse->picture_in_buffer == 0 && + data[offset + 1] == (GOP_START_CODE & 0xFF)) { + mp1videoparse->last_pts = gst_mp1videoparse_time_code (&data[2], + mp1videoparse->fps); + } else if (mp1videoparse->picture_in_buffer == 1) { + have_sync = TRUE; + break; + } else { + g_assert (mp1videoparse->picture_in_buffer == 0); + } + } + /* end-of-sequence is a valid sync point and should be included + * in the current picture, not the next. */ + else if (data[offset + 1] == (SEQ_END_CODE & 0xFF)) { + if (mp1videoparse->picture_in_buffer == 1) { + offset += 4; + have_sync = TRUE; + break; + } else { + g_assert (mp1videoparse->picture_in_buffer == 0); + } + } else + sync_state = 0; } /* something else... */ else - sync_state = 0; + sync_state = 0; /* go down the buffer */ offset++; } @@ -487,7 +488,7 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, if (have_sync) { offset -= 2; GST_DEBUG ("mp1videoparse: synced at %ld code 0x000001%02x", offset, - data[offset + 3]); + data[offset + 3]); outbuf = gst_buffer_create_sub (mp1videoparse->partialbuf, 0, offset + 4); g_assert (outbuf != NULL); @@ -496,31 +497,31 @@ gst_mp1videoparse_real_chain (Mp1VideoParse * mp1videoparse, GstBuffer * buf, mp1videoparse->last_pts += GST_BUFFER_DURATION (outbuf); if (mp1videoparse->in_flush) { - /* FIXME, send a flush event here */ - mp1videoparse->in_flush = FALSE; + /* FIXME, send a flush event here */ + mp1videoparse->in_flush = FALSE; } if (GST_PAD_CAPS (outpad) != NULL) { - GST_DEBUG ("mp1videoparse: pushing %d bytes %" G_GUINT64_FORMAT, - GST_BUFFER_SIZE (outbuf), GST_BUFFER_TIMESTAMP (outbuf)); - gst_pad_push (outpad, GST_DATA (outbuf)); - GST_DEBUG ("mp1videoparse: pushing done"); + GST_DEBUG ("mp1videoparse: pushing %d bytes %" G_GUINT64_FORMAT, + GST_BUFFER_SIZE (outbuf), GST_BUFFER_TIMESTAMP (outbuf)); + gst_pad_push (outpad, GST_DATA (outbuf)); + GST_DEBUG ("mp1videoparse: pushing done"); } else { - GST_DEBUG ("No capsnego yet, delaying buffer push"); - gst_buffer_unref (outbuf); + GST_DEBUG ("No capsnego yet, delaying buffer push"); + gst_buffer_unref (outbuf); } mp1videoparse->picture_in_buffer = 0; temp = - gst_buffer_create_sub (mp1videoparse->partialbuf, offset, - size - offset); + gst_buffer_create_sub (mp1videoparse->partialbuf, offset, + size - offset); gst_buffer_unref (mp1videoparse->partialbuf); mp1videoparse->partialbuf = temp; offset = 0; } else { if (time_stamp != GST_CLOCK_TIME_NONE) { - mp1videoparse->last_pts = time_stamp; - break; + mp1videoparse->last_pts = time_stamp; + break; } } } while (1); diff --git a/gst/mpeg2sub/gstmpeg2subt.c b/gst/mpeg2sub/gstmpeg2subt.c index 65047297..dbfb5d5c 100644 --- a/gst/mpeg2sub/gstmpeg2subt.c +++ b/gst/mpeg2sub/gstmpeg2subt.c @@ -104,9 +104,10 @@ gst_mpeg2subt_get_type (void) 0, (GInstanceInitFunc) gst_mpeg2subt_init, }; + mpeg2subt_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstMpeg2Subt", - &mpeg2subt_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstMpeg2Subt", + &mpeg2subt_info, 0); } return mpeg2subt_type; } @@ -128,7 +129,7 @@ gst_mpeg2subt_class_init (GstMpeg2SubtClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ parent_class = g_type_class_ref (GST_TYPE_ELEMENT); @@ -193,68 +194,68 @@ gst_mpeg2subt_parse_header (GstMpeg2Subt * mpeg2subt) while (i < mpeg2subt->packet_size) { dummy = buffer[i]; switch (dummy) { - case 0x01: /* null packet ? */ - i++; - break; - case 0x02: /* 02 ff (ff) is the end of the packet */ - i = mpeg2subt->packet_size; - break; - case 0x03: /* palette */ - mpeg2subt->color[0] = yuv_color[buffer[i + 1] >> 4]; - mpeg2subt->color[1] = yuv_color[buffer[i + 1] & 0xf]; - mpeg2subt->color[2] = yuv_color[buffer[i + 2] >> 4]; - mpeg2subt->color[3] = yuv_color[buffer[i + 2] & 0xf]; - mpeg2subt->color[4] = yuv_color[0xf]; - GST_DEBUG ("mpeg2subt: colors %d %d %d %d", mpeg2subt->color[0], - mpeg2subt->color[1], mpeg2subt->color[2], mpeg2subt->color[3]); - i += 3; - break; - case 0x04: /* transparency palette */ - mpeg2subt->trans[3] = buffer[i + 1] >> 4; - mpeg2subt->trans[2] = buffer[i + 1] & 0xf; - mpeg2subt->trans[1] = buffer[i + 2] >> 4; - mpeg2subt->trans[0] = buffer[i + 2] & 0xf; - GST_DEBUG ("mpeg2subt: transparency %d %d %d %d", mpeg2subt->trans[0], - mpeg2subt->trans[1], mpeg2subt->trans[2], mpeg2subt->trans[3]); - i += 3; - break; - case 0x05: /* image coordinates */ - mpeg2subt->width = 1 + (((buffer[i + 2] & 0x0f) << 8) + buffer[i + 3]) - - ((((unsigned int) buffer[i + 1]) << 4) + (buffer[i + 2] >> 4)); - mpeg2subt->height = 1 + (((buffer[i + 5] & 0x0f) << 8) + buffer[i + 6]) - - ((((unsigned int) buffer[i + 4]) << 4) + (buffer[i + 5] >> 4)); - i += 7; - break; - case 0x06: /* image 1 / image 2 offsets */ - mpeg2subt->offset[0] = - (((unsigned int) buffer[i + 1]) << 8) + buffer[i + 2]; - mpeg2subt->offset[1] = - (((unsigned int) buffer[i + 3]) << 8) + buffer[i + 4]; - i += 5; - break; - case 0xff: /* "ff xx yy zz uu" with 'zz uu' == start of control packet - * xx and yy are the end time in 90th/sec - */ - mpeg2subt->duration = - (((buffer[i + 1] << 8) + buffer[i + 2]) * 25) / 90; - - GST_DEBUG ("duration %d", mpeg2subt->duration); - - if ((buffer[i + 3] != buffer[mpeg2subt->data_size + 2]) - || (buffer[i + 4] != buffer[mpeg2subt->data_size + 3])) { - g_print - ("mpeg2subt: invalid control header (%.2x%.2x != %.2x%.2x) !\n", - buffer[i + 3], buffer[i + 4], buffer[mpeg2subt->data_size + 2], - buffer[mpeg2subt->data_size + 3]); + case 0x01: /* null packet ? */ + i++; + break; + case 0x02: /* 02 ff (ff) is the end of the packet */ + i = mpeg2subt->packet_size; + break; + case 0x03: /* palette */ + mpeg2subt->color[0] = yuv_color[buffer[i + 1] >> 4]; + mpeg2subt->color[1] = yuv_color[buffer[i + 1] & 0xf]; + mpeg2subt->color[2] = yuv_color[buffer[i + 2] >> 4]; + mpeg2subt->color[3] = yuv_color[buffer[i + 2] & 0xf]; + mpeg2subt->color[4] = yuv_color[0xf]; + GST_DEBUG ("mpeg2subt: colors %d %d %d %d", mpeg2subt->color[0], + mpeg2subt->color[1], mpeg2subt->color[2], mpeg2subt->color[3]); + i += 3; + break; + case 0x04: /* transparency palette */ + mpeg2subt->trans[3] = buffer[i + 1] >> 4; + mpeg2subt->trans[2] = buffer[i + 1] & 0xf; + mpeg2subt->trans[1] = buffer[i + 2] >> 4; + mpeg2subt->trans[0] = buffer[i + 2] & 0xf; + GST_DEBUG ("mpeg2subt: transparency %d %d %d %d", mpeg2subt->trans[0], + mpeg2subt->trans[1], mpeg2subt->trans[2], mpeg2subt->trans[3]); + i += 3; + break; + case 0x05: /* image coordinates */ + mpeg2subt->width = 1 + (((buffer[i + 2] & 0x0f) << 8) + buffer[i + 3]) + - ((((unsigned int) buffer[i + 1]) << 4) + (buffer[i + 2] >> 4)); + mpeg2subt->height = 1 + (((buffer[i + 5] & 0x0f) << 8) + buffer[i + 6]) + - ((((unsigned int) buffer[i + 4]) << 4) + (buffer[i + 5] >> 4)); + i += 7; + break; + case 0x06: /* image 1 / image 2 offsets */ + mpeg2subt->offset[0] = + (((unsigned int) buffer[i + 1]) << 8) + buffer[i + 2]; + mpeg2subt->offset[1] = + (((unsigned int) buffer[i + 3]) << 8) + buffer[i + 4]; + i += 5; + break; + case 0xff: /* "ff xx yy zz uu" with 'zz uu' == start of control packet + * xx and yy are the end time in 90th/sec + */ + mpeg2subt->duration = + (((buffer[i + 1] << 8) + buffer[i + 2]) * 25) / 90; + + GST_DEBUG ("duration %d", mpeg2subt->duration); + + if ((buffer[i + 3] != buffer[mpeg2subt->data_size + 2]) + || (buffer[i + 4] != buffer[mpeg2subt->data_size + 3])) { + g_print + ("mpeg2subt: invalid control header (%.2x%.2x != %.2x%.2x) !\n", + buffer[i + 3], buffer[i + 4], buffer[mpeg2subt->data_size + 2], + buffer[mpeg2subt->data_size + 3]); /* FIXME */ /* exit(1); */ - } - i += 5; - break; + } + i += 5; + break; default: - g_print ("mpeg2subt: invalid sequence in control header (%.2x) !\n", - dummy); - break; + g_print ("mpeg2subt: invalid sequence in control header (%.2x) !\n", + dummy); + break; } } } @@ -298,46 +299,46 @@ gst_mpeg2subt_merge_title (GstMpeg2Subt * mpeg2subt, GstBuffer * buf) gint length, colorid; code = get_nibble (); - if (code >= 0x4) { /* 4 .. f */ + if (code >= 0x4) { /* 4 .. f */ found_code: length = code >> 2; colorid = code & 3; while (length--) - if (x++ < width) { - if (mpeg2subt->trans[colorid] != 0x0) { - *target++ = mpeg2subt->color[colorid]; - } else - target++; - } + if (x++ < width) { + if (mpeg2subt->trans[colorid] != 0x0) { + *target++ = mpeg2subt->color[colorid]; + } else + target++; + } if (x >= width) { - if (!aligned) - get_nibble (); - goto next_line; + if (!aligned) + get_nibble (); + goto next_line; } continue; } code = (code << 4) + get_nibble (); - if (code >= 0x10) /* 1x .. 3x */ + if (code >= 0x10) /* 1x .. 3x */ goto found_code; code = (code << 4) + get_nibble (); - if (code >= 0x40) /* 04x .. 0fx */ + if (code >= 0x40) /* 04x .. 0fx */ goto found_code; code = (code << 4) + get_nibble (); - if (code >= 0x100) /* 01xx .. 03xx */ + if (code >= 0x100) /* 01xx .. 03xx */ goto found_code; /* 00xx - should only happen for 00 00 */ if (!aligned) - code = (code << 4) + get_nibble (); /* 0 0x xx */ + code = (code << 4) + get_nibble (); /* 0 0x xx */ if (code) { g_print - ("mpeg2subt: got unknown code 00%x (offset %x side %x, x=%d, y=%d)\n", - code, mpeg2subt->offset[id], id, x, y); + ("mpeg2subt: got unknown code 00%x (offset %x side %x, x=%d, y=%d)\n", + code, mpeg2subt->offset[id], id, x, y); goto next_line; } next_line: @@ -395,7 +396,7 @@ gst_mpeg2subt_chain_subtitle (GstPad * pad, GstData * _data) if (mpeg2subt->packet_size == size) { GST_DEBUG ("mpeg2subt: subtitle packet size %d, current size %ld", - mpeg2subt->packet_size, size); + mpeg2subt->packet_size, size); mpeg2subt->data_size = GUINT16_FROM_BE (*(guint16 *) (data + 2)); diff --git a/gst/mpegaudioparse/gstmpegaudioparse.c b/gst/mpegaudioparse/gstmpegaudioparse.c index 1e77bf42..4e5b9b00 100644 --- a/gst/mpegaudioparse/gstmpegaudioparse.c +++ b/gst/mpegaudioparse/gstmpegaudioparse.c @@ -36,9 +36,9 @@ static GstStaticPadTemplate mp3_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS ("audio/mpeg, " - "mpegversion = (int) 1, " - "layer = (int) [ 1, 3 ], " - "rate = (int) [ 8000, 48000], " "channels = (int) [ 1, 2 ]") + "mpegversion = (int) 1, " + "layer = (int) [ 1, 3 ], " + "rate = (int) [ 8000, 48000], " "channels = (int) [ 1, 2 ]") ); static GstStaticPadTemplate mp3_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", @@ -98,8 +98,9 @@ gst_mp3parse_get_type (void) 0, (GInstanceInitFunc) gst_mp3parse_init, }; + mp3parse_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstMPEGAudioParse", &mp3parse_info, 0); + "GstMPEGAudioParse", &mp3parse_info, 0); } return mp3parse_type; } @@ -238,8 +239,8 @@ gst_mp3parse_class_init (GstMPEGAudioParseClass * klass) gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE, g_param_spec_int ("bitrate", "Bitrate", "Bit Rate", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SKIP, g_param_spec_int ("skip", "skip", "skip", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BIT_RATE, g_param_spec_int ("bitrate", "Bitrate", "Bit Rate", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); /* CHECKME */ parent_class = g_type_class_ref (GST_TYPE_ELEMENT); @@ -354,89 +355,89 @@ gst_mp3parse_chain (GstPad * pad, GstData * _data) * the frames are not independently coded. ********************************************************************************/ if (mp3parse->in_flush) { - guint32 header2; + guint32 header2; - if ((size - offset) < (bpf + 4)) { - if (mp3parse->in_flush) - break; - } - /* wait until we have the the entire current frame as well as the next frame header */ - header2 = GUINT32_FROM_BE (*((guint32 *) (data + offset + bpf))); - GST_DEBUG ("mp3parse: header=%08X, header2=%08X, bpf=%d", - (unsigned int) header, (unsigned int) header2, bpf); + if ((size - offset) < (bpf + 4)) { + if (mp3parse->in_flush) + break; + } + /* wait until we have the the entire current frame as well as the next frame header */ + header2 = GUINT32_FROM_BE (*((guint32 *) (data + offset + bpf))); + GST_DEBUG ("mp3parse: header=%08X, header2=%08X, bpf=%d", + (unsigned int) header, (unsigned int) header2, bpf); /* mask the bits which are allowed to differ between frames */ #define HDRMASK ~((0xF << 12) /* bitrate */ | \ (0x1 << 9) /* padding */ | \ - (0x3 << 4)) /*mode extension */ + (0x3 << 4)) /*mode extension */ - if ((header2 & HDRMASK) != (header & HDRMASK)) { /* require 2 matching headers in a row */ - GST_DEBUG - ("mp3parse: next header doesn't match (header=%08X, header2=%08X, bpf=%d)", - (unsigned int) header, (unsigned int) header2, bpf); - offset++; /* This frame is invalid. Start looking for a valid frame at the next position in the stream */ - continue; - } + if ((header2 & HDRMASK) != (header & HDRMASK)) { /* require 2 matching headers in a row */ + GST_DEBUG + ("mp3parse: next header doesn't match (header=%08X, header2=%08X, bpf=%d)", + (unsigned int) header, (unsigned int) header2, bpf); + offset++; /* This frame is invalid. Start looking for a valid frame at the next position in the stream */ + continue; + } } /* if we don't have the whole frame... */ if ((size - offset) < bpf) { - GST_DEBUG ("mp3parse: partial buffer needed %ld < %d ", (size - offset), - bpf); - break; + GST_DEBUG ("mp3parse: partial buffer needed %ld < %d ", (size - offset), + bpf); + break; } else { - guint bitrate, layer, rate, channels; - - if (!mp3_type_frame_length_from_header (header, &layer, - &channels, &bitrate, &rate)) { - g_error ("Header failed internal error"); - } - if (channels != mp3parse->channels || - rate != mp3parse->rate || - layer != mp3parse->layer || bitrate != mp3parse->bit_rate) { - GstCaps *caps = mp3_caps_create (layer, channels, bitrate, rate); - - gst_pad_set_explicit_caps (mp3parse->srcpad, caps); - - mp3parse->channels = channels; - mp3parse->layer = layer; - mp3parse->rate = rate; - mp3parse->bit_rate = bitrate; - } - - outbuf = gst_buffer_create_sub (mp3parse->partialbuf, offset, bpf); - - offset += bpf; - if (mp3parse->skip == 0) { - GST_DEBUG ("mp3parse: pushing buffer of %d bytes", - GST_BUFFER_SIZE (outbuf)); - if (mp3parse->in_flush) { - /* FIXME do some sort of flush event */ - mp3parse->in_flush = FALSE; - } - GST_BUFFER_TIMESTAMP (outbuf) = last_ts; - GST_BUFFER_DURATION (outbuf) = - 8 * (GST_SECOND / 1000) * GST_BUFFER_SIZE (outbuf) / - mp3parse->bit_rate; - - if (GST_PAD_CAPS (mp3parse->srcpad) != NULL) { - gst_pad_push (mp3parse->srcpad, GST_DATA (outbuf)); - } else { - GST_DEBUG ("No capsnego yet, delaying buffer push"); - gst_buffer_unref (outbuf); - } - } else { - GST_DEBUG ("mp3parse: skipping buffer of %d bytes", - GST_BUFFER_SIZE (outbuf)); - gst_buffer_unref (outbuf); - mp3parse->skip--; - } + guint bitrate, layer, rate, channels; + + if (!mp3_type_frame_length_from_header (header, &layer, + &channels, &bitrate, &rate)) { + g_error ("Header failed internal error"); + } + if (channels != mp3parse->channels || + rate != mp3parse->rate || + layer != mp3parse->layer || bitrate != mp3parse->bit_rate) { + GstCaps *caps = mp3_caps_create (layer, channels, bitrate, rate); + + gst_pad_set_explicit_caps (mp3parse->srcpad, caps); + + mp3parse->channels = channels; + mp3parse->layer = layer; + mp3parse->rate = rate; + mp3parse->bit_rate = bitrate; + } + + outbuf = gst_buffer_create_sub (mp3parse->partialbuf, offset, bpf); + + offset += bpf; + if (mp3parse->skip == 0) { + GST_DEBUG ("mp3parse: pushing buffer of %d bytes", + GST_BUFFER_SIZE (outbuf)); + if (mp3parse->in_flush) { + /* FIXME do some sort of flush event */ + mp3parse->in_flush = FALSE; + } + GST_BUFFER_TIMESTAMP (outbuf) = last_ts; + GST_BUFFER_DURATION (outbuf) = + 8 * (GST_SECOND / 1000) * GST_BUFFER_SIZE (outbuf) / + mp3parse->bit_rate; + + if (GST_PAD_CAPS (mp3parse->srcpad) != NULL) { + gst_pad_push (mp3parse->srcpad, GST_DATA (outbuf)); + } else { + GST_DEBUG ("No capsnego yet, delaying buffer push"); + gst_buffer_unref (outbuf); + } + } else { + GST_DEBUG ("mp3parse: skipping buffer of %d bytes", + GST_BUFFER_SIZE (outbuf)); + gst_buffer_unref (outbuf); + mp3parse->skip--; + } } } else { offset++; if (!mp3parse->in_flush) - GST_DEBUG ("mp3parse: *** wrong header, skipping byte (FIXME?)"); + GST_DEBUG ("mp3parse: *** wrong header, skipping byte (FIXME?)"); } } /* if we have processed this block and there are still */ @@ -445,7 +446,7 @@ gst_mp3parse_chain (GstPad * pad, GstData * _data) glong remainder = (size - offset); GST_DEBUG ("mp3parse: partial buffer needed %ld for trailing bytes", - remainder); + remainder); outbuf = gst_buffer_create_sub (mp3parse->partialbuf, offset, remainder); gst_buffer_unref (mp3parse->partialbuf); @@ -462,7 +463,7 @@ bpf_from_header (GstMPEGAudioParse * parse, unsigned long header) guint bitrate, layer, rate, channels, length; if (!(length = mp3_type_frame_length_from_header (header, &layer, - &channels, &bitrate, &rate))) { + &channels, &bitrate, &rate))) { return 0; } diff --git a/gst/overlay/gstoverlay.c b/gst/overlay/gstoverlay.c index cf787e87..8efabe06 100644 --- a/gst/overlay/gstoverlay.c +++ b/gst/overlay/gstoverlay.c @@ -105,9 +105,10 @@ gst_overlay_get_type (void) 0, (GInstanceInitFunc) gst_overlay_init, }; + overlay_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstOverlay", &overlay_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstOverlay", &overlay_info, + 0); } return overlay_type; } @@ -155,18 +156,18 @@ gst_overlay_getcaps (GstPad * pad) if (overlay->width && overlay->height) { caps = GST_STATIC_CAPS ("overlay_sink2", - "video/raw", - "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), - "width", G_TYPE_INT (overlay->width), - "height", G_TYPE_INT (overlay->height) - ); + "video/raw", + "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), + "width", G_TYPE_INT (overlay->width), + "height", G_TYPE_INT (overlay->height) + ); } else { caps = GST_STATIC_CAPS ("overlay_sink2", - "video/raw", - "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), - "width", G_TYPE_INT_RANGE (0, 4096), - "height", G_TYPE_INT_RANGE (0, 4096) - ); + "video/raw", + "format", GST_TYPE_FOURCC (GST_MAKE_FOURCC ('I', '4', '2', '0')), + "width", G_TYPE_INT_RANGE (0, 4096), + "height", G_TYPE_INT_RANGE (0, 4096) + ); } return caps; @@ -246,22 +247,22 @@ gst_overlay_blend_i420 (guint8 * out, guint8 * in1, guint8 * in2, guint8 * in3, for (j = 0; j < width; j++) { mask = in3[i * width + j]; out[i * width + j] = ((in1[i * width + j] * mask) + - (in2[i * width + j] * (255 - mask))) >> 8; + (in2[i * width + j] * (255 - mask))) >> 8; } } for (i = 0; i < height / 2; i++) { for (j = 0; j < width / 2; j++) { mask = - (in3[(i * 2) * width + (j * 2)] + in3[(i * 2 + 1) * width + (j * 2)] + - in3[(i * 2) * width + (j * 2 + 1)] + in3[(i * 2 + 1) * width + - (j * 2 + 1)]) / 4; + (in3[(i * 2) * width + (j * 2)] + in3[(i * 2 + 1) * width + (j * 2)] + + in3[(i * 2) * width + (j * 2 + 1)] + in3[(i * 2 + 1) * width + + (j * 2 + 1)]) / 4; outu[i * width2 + j] = - ((in1u[i * width2 + j] * mask) + (in2u[i * width2 + j] * (255 - - mask))) >> 8; + ((in1u[i * width2 + j] * mask) + (in2u[i * width2 + j] * (255 - + mask))) >> 8; outv[i * width2 + j] = - ((in1v[i * width2 + j] * mask) + (in2v[i * width2 + j] * (255 - - mask))) >> 8; + ((in1v[i * width2 + j] * mask) + (in2v[i * width2 + j] * (255 - + mask))) >> 8; } } } diff --git a/gst/passthrough/gstpassthrough.c b/gst/passthrough/gstpassthrough.c index 37fecf78..355a5013 100644 --- a/gst/passthrough/gstpassthrough.c +++ b/gst/passthrough/gstpassthrough.c @@ -56,7 +56,7 @@ static GstStaticPadTemplate passthrough_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static GstStaticPadTemplate passthrough_src_template = @@ -64,7 +64,7 @@ static GstStaticPadTemplate passthrough_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static void passthrough_class_init (GstPassthroughClass * klass); @@ -118,17 +118,17 @@ passthrough_connect_sink (GstPad * pad, const GstCaps * caps) if (!filter->silent) { g_print ("Passthrough : channels %d, rate %d\n", filter->channels, - filter->rate); + filter->rate); g_print - ("Passthrough : format int, bit width %d, endianness %d, signed %s\n", - filter->width, filter->endianness, filter->is_signed ? "yes" : "no"); + ("Passthrough : format int, bit width %d, endianness %d, signed %s\n", + filter->width, filter->endianness, filter->is_signed ? "yes" : "no"); } } else if (strcmp (mimetype, "audio/x-raw-float") == 0) { filter->format = GST_PASSTHROUGH_FORMAT_FLOAT; if (!filter->silent) { g_print ("Passthrough : channels %d, rate %d\n", filter->channels, - filter->rate); + filter->rate); g_print ("Passthrough : format float, width %d\n", filter->width); } } @@ -153,9 +153,10 @@ gst_passthrough_get_type (void) 0, (GInstanceInitFunc) passthrough_init, }; + passthrough_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstPassthrough", - &passthrough_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstPassthrough", + &passthrough_info, 0); } return passthrough_type; } @@ -183,7 +184,7 @@ passthrough_class_init (GstPassthroughClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT, g_param_spec_boolean ("silent", "silent", "silent", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SILENT, g_param_spec_boolean ("silent", "silent", "silent", TRUE, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = passthrough_set_property; gobject_class->get_property = passthrough_get_property; @@ -228,13 +229,13 @@ passthrough_chain (GstPad * pad, GstData * _data) int_data = (gint16 *) GST_BUFFER_DATA (buf); switch (filter->width) { - case 16: - passthrough_fast_16bit_chain (int_data, GST_BUFFER_SIZE (buf) / 2); - break; - case 8: - passthrough_fast_8bit_chain ((gint8 *) int_data, - GST_BUFFER_SIZE (buf)); - break; + case 16: + passthrough_fast_16bit_chain (int_data, GST_BUFFER_SIZE (buf) / 2); + break; + case 8: + passthrough_fast_8bit_chain ((gint8 *) int_data, + GST_BUFFER_SIZE (buf)); + break; } break; @@ -242,7 +243,7 @@ passthrough_chain (GstPad * pad, GstData * _data) float_data = (gfloat *) GST_BUFFER_DATA (buf); passthrough_fast_float_chain (float_data, - GST_BUFFER_SIZE (buf) / sizeof (gfloat)); + GST_BUFFER_SIZE (buf) / sizeof (gfloat)); break; } @@ -254,13 +255,13 @@ static void inline passthrough_fast_float_chain (gfloat * data, guint num_samples) #include "filter.func" static void inline - passthrough_fast_16bit_chain (gint16 * data, guint num_samples) + passthrough_fast_16bit_chain (gint16 * data, guint num_samples) #include "filter.func" static void inline - passthrough_fast_8bit_chain (gint8 * data, guint num_samples) + passthrough_fast_8bit_chain (gint8 * data, guint num_samples) #include "filter.func" static void - passthrough_set_property (GObject * object, guint prop_id, + passthrough_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstPassthrough *filter; diff --git a/gst/playondemand/demo-mp3.c b/gst/playondemand/demo-mp3.c index 907f7379..efae8ebf 100644 --- a/gst/playondemand/demo-mp3.c +++ b/gst/playondemand/demo-mp3.c @@ -22,7 +22,7 @@ played (GstElement * pod, gpointer data) g_print ("Played beat at %02u, beats are ", (guint) (gst_clock_get_time (element_clock) / GST_SECOND * - (GTK_ADJUSTMENT (speed_adj))->value) % NUM_BEATS); + (GTK_ADJUSTMENT (speed_adj))->value) % NUM_BEATS); for (i = 0; i <= NUM_BEATS / 32; i++) g_print ("%08x ", beats[i]); @@ -120,7 +120,7 @@ setup_gui (void) for (i = 0; i < NUM_BEATS; i++) beat_button[i] = - gtk_toggle_button_new_with_label (g_strdup_printf ("%2d", i + 1)); + gtk_toggle_button_new_with_label (g_strdup_printf ("%2d", i + 1)); speed_adj = gtk_adjustment_new (1, 0.0, 10.0, 0.1, 1.0, 0.0); speed_scale = gtk_hscale_new (GTK_ADJUSTMENT (speed_adj)); @@ -156,7 +156,7 @@ setup_gui (void) NULL); for (i = 0; i < NUM_BEATS; i++) g_signal_connect (G_OBJECT (beat_button[i]), "toggled", G_CALLBACK (beat), - GUINT_TO_POINTER (i)); + GUINT_TO_POINTER (i)); /* show the gui. */ gtk_widget_show_all (window); diff --git a/gst/playondemand/gstplayondemand.c b/gst/playondemand/gstplayondemand.c index b3d8d909..5a2b8be6 100644 --- a/gst/playondemand/gstplayondemand.c +++ b/gst/playondemand/gstplayondemand.c @@ -32,9 +32,9 @@ * way beyond what a real computer can actually keep track of, but hey ... */ /* some default values */ -#define GST_POD_MAX_PLAYS 100 /* maximum simultaneous plays */ -#define GST_POD_BUFFER_TIME 5.0 /* buffer length in seconds */ -#define GST_POD_TICK_RATE 1e-6 /* ticks per second */ +#define GST_POD_MAX_PLAYS 100 /* maximum simultaneous plays */ +#define GST_POD_BUFFER_TIME 5.0 /* buffer length in seconds */ +#define GST_POD_TICK_RATE 1e-6 /* ticks per second */ /* buffer pool fallback values ... use if no buffer pool is available */ #define GST_POD_BUFPOOL_SIZE 4096 @@ -54,7 +54,7 @@ static GstStaticPadTemplate play_on_demand_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static GstStaticPadTemplate play_on_demand_src_template = @@ -62,7 +62,7 @@ static GstStaticPadTemplate play_on_demand_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); @@ -109,8 +109,9 @@ gst_play_on_demand_get_type (void) 0, (GInstanceInitFunc) play_on_demand_init, }; + play_on_demand_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstPlayOnDemand", &play_on_demand_info, 0); + "GstPlayOnDemand", &play_on_demand_info, 0); } return play_on_demand_type; } @@ -203,33 +204,33 @@ play_on_demand_class_init (GstPlayOnDemandClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MUTE, g_param_spec_boolean ("mute", "Silence output", "Do not output any sound", - FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + FALSE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_BUFFER_TIME, g_param_spec_float ("buffer-time", "Buffer length in seconds", - "Number of seconds of audio the buffer holds", 0.0, G_MAXFLOAT, - GST_POD_BUFFER_TIME, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "Number of seconds of audio the buffer holds", 0.0, G_MAXFLOAT, + GST_POD_BUFFER_TIME, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_MAX_PLAYS, g_param_spec_uint ("max-plays", "Maximum simultaneous playbacks", - "Maximum allowed number of simultaneous plays from the buffer", 1, - G_MAXUINT, GST_POD_MAX_PLAYS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "Maximum allowed number of simultaneous plays from the buffer", 1, + G_MAXUINT, GST_POD_MAX_PLAYS, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TICK_RATE, g_param_spec_float ("tick-rate", "Tick rate (ticks/second)", - "The rate of musical ticks, the smallest time unit in a song", 0, - G_MAXFLOAT, GST_POD_TICK_RATE, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "The rate of musical ticks, the smallest time unit in a song", 0, + G_MAXFLOAT, GST_POD_TICK_RATE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TOTAL_TICKS, g_param_spec_uint ("total-ticks", "Total number of ticks", - "Total number of ticks in the tick array", 1, G_MAXUINT, 1, - G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + "Total number of ticks in the tick array", 1, G_MAXUINT, 1, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_TICKS, g_param_spec_pointer ("ticks", "Ticks to play sample on", - "An array of ticks (musical times) at which to play the sample", - G_PARAM_READWRITE)); + "An array of ticks (musical times) at which to play the sample", + G_PARAM_READWRITE)); } static void @@ -282,7 +283,7 @@ play_on_demand_set_property (GObject * object, guint prop_id, /* clear out now-invalid play pointers */ for (i = 0; i < filter->max_plays; i++) - filter->plays[i] = G_MAXUINT; + filter->plays[i] = G_MAXUINT; break; case PROP_MAX_PLAYS: @@ -291,9 +292,9 @@ play_on_demand_set_property (GObject * object, guint prop_id, new_plays = g_new (guint, new_size); for (i = 0; i < min_size; i++) - new_plays[i] = filter->plays[i]; + new_plays[i] = filter->plays[i]; for (i = min_size; i < new_size; i++) - new_plays[i] = G_MAXUINT; + new_plays[i] = G_MAXUINT; g_free (filter->plays); filter->plays = new_plays; @@ -306,13 +307,13 @@ play_on_demand_set_property (GObject * object, guint prop_id, case PROP_TOTAL_TICKS: new_size = g_value_get_uint (value); min_size = - (new_size < filter->total_ticks) ? new_size : filter->total_ticks; + (new_size < filter->total_ticks) ? new_size : filter->total_ticks; new_ticks = g_new (guint32, new_size / 32 + 1); for (i = 0; i <= min_size / 32; i++) - new_ticks[i] = filter->ticks[i]; + new_ticks[i] = filter->ticks[i]; for (i = min_size / 32 + 1; i <= new_size / 32; i++) - new_ticks[i] = 0; + new_ticks[i] = 0; g_free (filter->ticks); filter->ticks = new_ticks; @@ -322,8 +323,8 @@ play_on_demand_set_property (GObject * object, guint prop_id, case PROP_TICKS: new_ticks = (guint *) g_value_get_pointer (value); if (new_ticks) { - g_free (filter->ticks); - filter->ticks = new_ticks; + g_free (filter->ticks); + filter->ticks = new_ticks; } break; default: @@ -415,10 +416,10 @@ play_on_demand_add_play_pointer (GstPlayOnDemand * filter, guint pos) if (filter->rate && ((filter->buffer_time * filter->rate) > pos)) { for (i = 0; i < filter->max_plays; i++) { if (filter->plays[i] == G_MAXUINT) { - filter->plays[i] = pos; - /* emit a signal to indicate a sample being played */ - g_signal_emit (filter, gst_pod_filter_signals[PLAYED_SIGNAL], 0); - break; + filter->plays[i] = pos; + /* emit a signal to indicate a sample being played */ + g_signal_emit (filter, gst_pod_filter_signals[PLAYED_SIGNAL], 0); + break; } } } diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c index f7914e24..ad1e3232 100644 --- a/gst/qtdemux/qtdemux.c +++ b/gst/qtdemux/qtdemux.c @@ -173,9 +173,10 @@ gst_qtdemux_get_type (void) NULL, NULL, sizeof (GstQTDemux), 0, (GInstanceInitFunc) gst_qtdemux_init, }; + qtdemux_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstQTDemux", &qtdemux_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstQTDemux", &qtdemux_info, + 0); } return qtdemux_type; } @@ -254,35 +255,35 @@ gst_qtdemux_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, switch (src_format) { case GST_FORMAT_TIME: switch (*dest_format) { - case GST_FORMAT_BYTES: - *dest_value = src_value * 1; /* FIXME */ - break; - case GST_FORMAT_DEFAULT: - *dest_value = src_value * 1; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_BYTES: + *dest_value = src_value * 1; /* FIXME */ + break; + case GST_FORMAT_DEFAULT: + *dest_value = src_value * 1; /* FIXME */ + break; + default: + res = FALSE; + break; } break; case GST_FORMAT_BYTES: switch (*dest_format) { - case GST_FORMAT_TIME: - *dest_value = src_value * 1; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *dest_value = src_value * 1; /* FIXME */ + break; + default: + res = FALSE; + break; } break; case GST_FORMAT_DEFAULT: switch (*dest_format) { - case GST_FORMAT_TIME: - *dest_value = src_value * 1; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *dest_value = src_value * 1; /* FIXME */ + break; + default: + res = FALSE; + break; } break; default: @@ -326,34 +327,34 @@ gst_qtdemux_handle_src_query (GstPad * pad, GstQueryType type, switch (type) { case GST_QUERY_TOTAL: switch (*format) { - case GST_FORMAT_TIME: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_BYTES: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_DEFAULT: - *value = 0; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_BYTES: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_DEFAULT: + *value = 0; /* FIXME */ + break; + default: + res = FALSE; + break; } break; case GST_QUERY_POSITION: switch (*format) { - case GST_FORMAT_TIME: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_BYTES: - *value = 0; /* FIXME */ - break; - case GST_FORMAT_DEFAULT: - *value = 0; /* FIXME */ - break; - default: - res = FALSE; - break; + case GST_FORMAT_TIME: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_BYTES: + *value = 0; /* FIXME */ + break; + case GST_FORMAT_DEFAULT: + *value = 0; /* FIXME */ + break; + default: + res = FALSE; + break; } break; default: @@ -376,19 +377,19 @@ gst_qtdemux_handle_src_event (GstPad * pad, GstEvent * event) GST_DEBUG ("seek format %d", GST_EVENT_SEEK_FORMAT (event)); switch (GST_EVENT_SEEK_FORMAT (event)) { - case GST_FORMAT_BYTES: - case GST_FORMAT_DEFAULT: - case GST_FORMAT_TIME: - { - gint64 desired_offset = GST_EVENT_SEEK_OFFSET (event); - - GST_DEBUG ("seeking to %" G_GINT64_FORMAT, desired_offset); - - res = FALSE; - } - default: - res = FALSE; - break; + case GST_FORMAT_BYTES: + case GST_FORMAT_DEFAULT: + case GST_FORMAT_TIME: + { + gint64 desired_offset = GST_EVENT_SEEK_OFFSET (event); + + GST_DEBUG ("seeking to %" G_GINT64_FORMAT, desired_offset); + + res = FALSE; + } + default: + res = FALSE; + break; } default: res = FALSE; @@ -509,14 +510,14 @@ gst_qtdemux_loop_header (GstElement * element) case QTDEMUX_STATE_HEADER: { do { - ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 16); - if (ret < 16) { - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } + ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 16); + if (ret < 16) { + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } } while (1); length = GUINT32_FROM_BE (*(guint32 *) data); @@ -525,58 +526,58 @@ gst_qtdemux_loop_header (GstElement * element) GST_DEBUG ("fourcc " GST_FOURCC_FORMAT, GST_FOURCC_ARGS (fourcc)); if (length == 0) { - length = gst_bytestream_length (qtdemux->bs) - cur_offset; + length = gst_bytestream_length (qtdemux->bs) - cur_offset; } if (length == 1) { - guint32 length1, length2; + guint32 length1, length2; - length1 = GUINT32_FROM_BE (*(guint32 *) (data + 8)); - GST_DEBUG ("length1 %08x", length1); - length2 = GUINT32_FROM_BE (*(guint32 *) (data + 12)); - GST_DEBUG ("length2 %08x", length2); + length1 = GUINT32_FROM_BE (*(guint32 *) (data + 8)); + GST_DEBUG ("length1 %08x", length1); + length2 = GUINT32_FROM_BE (*(guint32 *) (data + 12)); + GST_DEBUG ("length2 %08x", length2); - length = length2; + length = length2; } switch (fourcc) { - case GST_MAKE_FOURCC ('m', 'd', 'a', 't'): - case GST_MAKE_FOURCC ('f', 'r', 'e', 'e'): - case GST_MAKE_FOURCC ('w', 'i', 'd', 'e'): - case GST_MAKE_FOURCC ('P', 'I', 'C', 'T'): - case GST_MAKE_FOURCC ('p', 'n', 'o', 't'): - break; - case GST_MAKE_FOURCC ('m', 'o', 'o', 'v'): - { - GstBuffer *moov; - - do { - ret = gst_bytestream_read (qtdemux->bs, &moov, length); - if (ret < length) { - GST_DEBUG ("read failed (%d < %d)", ret, length); - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } - } while (1); - - qtdemux_parse_moov (qtdemux, GST_BUFFER_DATA (moov), length); - if (1) - qtdemux_node_dump (qtdemux, qtdemux->moov_node); - qtdemux_parse_tree (qtdemux); - qtdemux->state = QTDEMUX_STATE_MOVIE; - break; - } - default: - { - GST_LOG ("unknown %08x '" GST_FOURCC_FORMAT "' at %d\n", - fourcc, GST_FOURCC_ARGS (fourcc), cur_offset); - break; - } + case GST_MAKE_FOURCC ('m', 'd', 'a', 't'): + case GST_MAKE_FOURCC ('f', 'r', 'e', 'e'): + case GST_MAKE_FOURCC ('w', 'i', 'd', 'e'): + case GST_MAKE_FOURCC ('P', 'I', 'C', 'T'): + case GST_MAKE_FOURCC ('p', 'n', 'o', 't'): + break; + case GST_MAKE_FOURCC ('m', 'o', 'o', 'v'): + { + GstBuffer *moov; + + do { + ret = gst_bytestream_read (qtdemux->bs, &moov, length); + if (ret < length) { + GST_DEBUG ("read failed (%d < %d)", ret, length); + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } + } while (1); + + qtdemux_parse_moov (qtdemux, GST_BUFFER_DATA (moov), length); + if (1) + qtdemux_node_dump (qtdemux, qtdemux->moov_node); + qtdemux_parse_tree (qtdemux); + qtdemux->state = QTDEMUX_STATE_MOVIE; + break; + } + default: + { + GST_LOG ("unknown %08x '" GST_FOURCC_FORMAT "' at %d\n", + fourcc, GST_FOURCC_ARGS (fourcc), cur_offset); + break; + } } ret = gst_bytestream_seek (qtdemux->bs, cur_offset + length, - GST_SEEK_METHOD_SET); + GST_SEEK_METHOD_SET); qtdemux->offset = cur_offset + length; GST_DEBUG ("seek returned %d\n", ret); break; @@ -586,14 +587,14 @@ gst_qtdemux_loop_header (GstElement * element) guint8 *data; do { - ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 1); - if (ret < 1) { - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } + ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 1); + if (ret < 1) { + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } } while (TRUE); gst_element_set_eos (element); @@ -612,25 +613,25 @@ gst_qtdemux_loop_header (GstElement * element) min_time = G_MAXUINT64; for (i = 0; i < qtdemux->n_streams; i++) { - stream = qtdemux->streams[i]; + stream = qtdemux->streams[i]; - if (stream->sample_index < stream->n_samples && - stream->samples[stream->sample_index].timestamp < min_time) { - min_time = stream->samples[stream->sample_index].timestamp; - index = i; - } + if (stream->sample_index < stream->n_samples && + stream->samples[stream->sample_index].timestamp < min_time) { + min_time = stream->samples[stream->sample_index].timestamp; + index = i; + } } if (index == -1) { - for (i = 0; i < qtdemux->n_streams; i++) { - gst_pad_push (qtdemux->streams[i]->pad, - GST_DATA (gst_event_new (GST_EVENT_EOS))); - } - ret = gst_bytestream_seek (qtdemux->bs, 0, GST_SEEK_METHOD_END); - GST_DEBUG ("seek returned %d", ret); - - qtdemux->state = QTDEMUX_STATE_SEEKING_EOS; - return; + for (i = 0; i < qtdemux->n_streams; i++) { + gst_pad_push (qtdemux->streams[i]->pad, + GST_DATA (gst_event_new (GST_EVENT_EOS))); + } + ret = gst_bytestream_seek (qtdemux->bs, 0, GST_SEEK_METHOD_END); + GST_DEBUG ("seek returned %d", ret); + + qtdemux->state = QTDEMUX_STATE_SEEKING_EOS; + return; } stream = qtdemux->streams[index]; @@ -639,53 +640,53 @@ gst_qtdemux_loop_header (GstElement * element) size = stream->samples[stream->sample_index].size; GST_INFO - ("pushing from stream %d, sample_index=%d offset=%d size=%d timestamp=%lld", - index, stream->sample_index, offset, size, - stream->samples[stream->sample_index].timestamp); + ("pushing from stream %d, sample_index=%d offset=%d size=%d timestamp=%lld", + index, stream->sample_index, offset, size, + stream->samples[stream->sample_index].timestamp); cur_offset = gst_bytestream_tell (qtdemux->bs); if (offset != cur_offset) { - GST_DEBUG ("seeking to offset %d", offset); - GST_LOG ("seeking to offset %d\n", offset); - ret = gst_bytestream_seek (qtdemux->bs, offset, GST_SEEK_METHOD_SET); - GST_DEBUG ("seek returned %d", ret); - return; + GST_DEBUG ("seeking to offset %d", offset); + GST_LOG ("seeking to offset %d\n", offset); + ret = gst_bytestream_seek (qtdemux->bs, offset, GST_SEEK_METHOD_SET); + GST_DEBUG ("seek returned %d", ret); + return; } GST_DEBUG ("reading %d bytes\n", size); buf = NULL; do { - ret = gst_bytestream_read (qtdemux->bs, &buf, size); - if (ret < size) { - GST_DEBUG ("read failed (%d < %d)", ret, size); - if (!gst_qtdemux_handle_sink_event (qtdemux)) { - return; - } - } else { - break; - } + ret = gst_bytestream_read (qtdemux->bs, &buf, size); + if (ret < size) { + GST_DEBUG ("read failed (%d < %d)", ret, size); + if (!gst_qtdemux_handle_sink_event (qtdemux)) { + return; + } + } else { + break; + } } while (TRUE); if (buf) { - /* hum... */ - if (stream->subtype == GST_MAKE_FOURCC ('v', 'i', 'd', 'e')) { - float fps = - 1. * GST_SECOND / stream->samples[stream->sample_index].duration; - if (fps != stream->fps) { - gst_caps_set_simple (stream->caps, "framerate", G_TYPE_DOUBLE, fps, - NULL); - stream->fps = fps; - gst_pad_set_explicit_caps (stream->pad, stream->caps); - } - } - - GST_BUFFER_TIMESTAMP (buf) = - stream->samples[stream->sample_index].timestamp; - GST_BUFFER_DURATION (buf) = - stream->samples[stream->sample_index].duration; - gst_pad_push (stream->pad, GST_DATA (buf)); - - GST_DEBUG ("pushing buffer on %" GST_PTR_FORMAT, stream->pad); + /* hum... */ + if (stream->subtype == GST_MAKE_FOURCC ('v', 'i', 'd', 'e')) { + float fps = + 1. * GST_SECOND / stream->samples[stream->sample_index].duration; + if (fps != stream->fps) { + gst_caps_set_simple (stream->caps, "framerate", G_TYPE_DOUBLE, fps, + NULL); + stream->fps = fps; + gst_pad_set_explicit_caps (stream->pad, stream->caps); + } + } + + GST_BUFFER_TIMESTAMP (buf) = + stream->samples[stream->sample_index].timestamp; + GST_BUFFER_DURATION (buf) = + stream->samples[stream->sample_index].duration; + gst_pad_push (stream->pad, GST_DATA (buf)); + + GST_DEBUG ("pushing buffer on %" GST_PTR_FORMAT, stream->pad); } stream->sample_index++; break; @@ -704,28 +705,28 @@ gst_qtdemux_add_stream (GstQTDemux * qtdemux, QtDemuxStream * stream) gchar *name = g_strdup_printf ("video_%02d", qtdemux->n_video_streams); stream->pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_qtdemux_videosrc_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&gst_qtdemux_videosrc_template), name); g_free (name); stream->fps = 1. * GST_SECOND / stream->samples[0].duration; if (stream->caps) { gst_caps_set_simple (stream->caps, - "width", G_TYPE_INT, stream->width, - "height", G_TYPE_INT, stream->height, - "framerate", G_TYPE_DOUBLE, stream->fps, NULL); + "width", G_TYPE_INT, stream->width, + "height", G_TYPE_INT, stream->height, + "framerate", G_TYPE_DOUBLE, stream->fps, NULL); } qtdemux->n_video_streams++; } else { gchar *name = g_strdup_printf ("audio_%02d", qtdemux->n_audio_streams); stream->pad = - gst_pad_new_from_template (gst_static_pad_template_get - (&gst_qtdemux_audiosrc_template), name); + gst_pad_new_from_template (gst_static_pad_template_get + (&gst_qtdemux_audiosrc_template), name); g_free (name); if (stream->caps) { gst_caps_set_simple (stream->caps, - "rate", G_TYPE_INT, (int) stream->rate, - "channels", G_TYPE_INT, stream->n_channels, NULL); + "rate", G_TYPE_INT, (int) stream->rate, + "channels", G_TYPE_INT, stream->n_channels, NULL); } qtdemux->n_audio_streams++; } @@ -819,7 +820,7 @@ QtNodeType qt_node_types[] = { qtdemux_dump_mvhd}, {FOURCC_clip, "clipping", QT_CONTAINER,}, {FOURCC_trak, "track", QT_CONTAINER,}, - {FOURCC_udta, "user data", 0,}, /* special container */ + {FOURCC_udta, "user data", 0,}, /* special container */ {FOURCC_ctab, "color table", 0,}, {FOURCC_tkhd, "track header", 0, qtdemux_dump_tkhd}, @@ -832,7 +833,7 @@ QtNodeType qt_node_types[] = { {FOURCC_load, "track load settings", 0,}, {FOURCC_tref, "track reference", QT_CONTAINER,}, {FOURCC_imap, "track input map", QT_CONTAINER,}, - {FOURCC___in, "track input", 0,}, /* special container */ + {FOURCC___in, "track input", 0,}, /* special container */ {FOURCC___ty, "input type", 0,}, {FOURCC_mdia, "media", QT_CONTAINER}, {FOURCC_mdhd, "media header", 0, @@ -940,7 +941,7 @@ qtdemux_parse_moov (GstQTDemux * qtdemux, void *buffer, int length) cmvd = qtdemux_tree_get_child_by_type (cmov, FOURCC_cmvd); if (QTDEMUX_FOURCC_GET (dcom->data + 8) == GST_MAKE_FOURCC ('z', 'l', 'i', - 'b')) { + 'b')) { int uncompressed_length; int compressed_length; void *buf; @@ -950,7 +951,7 @@ qtdemux_parse_moov (GstQTDemux * qtdemux, void *buffer, int length) GST_LOG ("length = %d\n", uncompressed_length); buf = qtdemux_inflate (cmvd->data + 12, compressed_length, - uncompressed_length); + uncompressed_length); qtdemux->moov_node_compressed = qtdemux->moov_node; qtdemux->moov_node = g_node_new (buf); @@ -990,8 +991,8 @@ qtdemux_parse (GstQTDemux * qtdemux, GNode * node, void *buffer, int length) GNode *child; if (buf + 8 >= end) { - /* FIXME: get annoyed */ - GST_LOG ("buffer overrun\n"); + /* FIXME: get annoyed */ + GST_LOG ("buffer overrun\n"); } len = QTDEMUX_GUINT32_GET (buf); @@ -1011,24 +1012,24 @@ qtdemux_parse (GstQTDemux * qtdemux, GNode * node, void *buffer, int length) GST_LOG ("length = %d\n", uncompressed_length); buf = - qtdemux_inflate (buffer + 12, node_length - 12, uncompressed_length); + qtdemux_inflate (buffer + 12, node_length - 12, uncompressed_length); end = buf + uncompressed_length; while (buf < end) { - GNode *child; - guint32 len; + GNode *child; + guint32 len; - if (buf + 8 >= end) { - /* FIXME: get annoyed */ - GST_LOG ("buffer overrun\n"); - } - len = QTDEMUX_GUINT32_GET (buf); + if (buf + 8 >= end) { + /* FIXME: get annoyed */ + GST_LOG ("buffer overrun\n"); + } + len = QTDEMUX_GUINT32_GET (buf); - child = g_node_new (buf); - g_node_append (node, child); - qtdemux_parse (qtdemux, child, buf, len); + child = g_node_new (buf); + g_node_append (node, child); + qtdemux_parse (qtdemux, child, buf, len); - buf += len; + buf += len; } } #endif @@ -1150,11 +1151,11 @@ qtdemux_dump_elst (GstQTDemux * qtdemux, void *buffer, int depth) n = QTDEMUX_GUINT32_GET (buffer + 12); for (i = 0; i < n; i++) { GST_LOG ("%*s track dur: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + 16 + i * 12)); + QTDEMUX_GUINT32_GET (buffer + 16 + i * 12)); GST_LOG ("%*s media time: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + 20 + i * 12)); + QTDEMUX_GUINT32_GET (buffer + 20 + i * 12)); GST_LOG ("%*s media rate: %g\n", depth, "", - QTDEMUX_FP32_GET (buffer + 24 + i * 12)); + QTDEMUX_FP32_GET (buffer + 24 + i * 12)); } } @@ -1222,9 +1223,9 @@ qtdemux_dump_dref (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s type: " GST_FOURCC_FORMAT "\n", depth, "", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); offset += QTDEMUX_GUINT32_GET (buffer + offset); } } @@ -1244,39 +1245,39 @@ qtdemux_dump_stsd (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s type: " GST_FOURCC_FORMAT "\n", depth, "", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 4))); GST_LOG ("%*s data reference:%d\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 14)); + QTDEMUX_GUINT16_GET (buffer + offset + 14)); GST_LOG ("%*s version/rev.: %08x\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 16)); + QTDEMUX_GUINT32_GET (buffer + offset + 16)); GST_LOG ("%*s vendor: " GST_FOURCC_FORMAT "\n", depth, "", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 20))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (buffer + offset + 20))); GST_LOG ("%*s temporal qual: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 24)); + QTDEMUX_GUINT32_GET (buffer + offset + 24)); GST_LOG ("%*s spatial qual: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 28)); + QTDEMUX_GUINT32_GET (buffer + offset + 28)); GST_LOG ("%*s width: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 32)); + QTDEMUX_GUINT16_GET (buffer + offset + 32)); GST_LOG ("%*s height: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 34)); + QTDEMUX_GUINT16_GET (buffer + offset + 34)); GST_LOG ("%*s horiz. resol: %g\n", depth, "", - QTDEMUX_FP32_GET (buffer + offset + 36)); + QTDEMUX_FP32_GET (buffer + offset + 36)); GST_LOG ("%*s vert. resol.: %g\n", depth, "", - QTDEMUX_FP32_GET (buffer + offset + 40)); + QTDEMUX_FP32_GET (buffer + offset + 40)); GST_LOG ("%*s data size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 44)); + QTDEMUX_GUINT32_GET (buffer + offset + 44)); GST_LOG ("%*s frame count: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 48)); + QTDEMUX_GUINT16_GET (buffer + offset + 48)); GST_LOG ("%*s compressor: %*s\n", depth, "", - QTDEMUX_GUINT8_GET (buffer + offset + 49), - (char *) (buffer + offset + 51)); + QTDEMUX_GUINT8_GET (buffer + offset + 49), + (char *) (buffer + offset + 51)); GST_LOG ("%*s depth: %u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 82)); + QTDEMUX_GUINT16_GET (buffer + offset + 82)); GST_LOG ("%*s color table ID:%u\n", depth, "", - QTDEMUX_GUINT16_GET (buffer + offset + 84)); + QTDEMUX_GUINT16_GET (buffer + offset + 84)); offset += QTDEMUX_GUINT32_GET (buffer + offset); } @@ -1297,9 +1298,9 @@ qtdemux_dump_stts (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s count: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s duration: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 4)); + QTDEMUX_GUINT32_GET (buffer + offset + 4)); offset += 8; } @@ -1320,7 +1321,7 @@ qtdemux_dump_stss (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s sample: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); offset += 4; } @@ -1341,11 +1342,11 @@ qtdemux_dump_stsc (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s first chunk: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); GST_LOG ("%*s sample per ch: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 4)); + QTDEMUX_GUINT32_GET (buffer + offset + 4)); GST_LOG ("%*s sample desc id:%08x\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset + 8)); + QTDEMUX_GUINT32_GET (buffer + offset + 8)); offset += 12; } @@ -1366,12 +1367,12 @@ qtdemux_dump_stsz (GstQTDemux * qtdemux, void *buffer, int depth) sample_size = QTDEMUX_GUINT32_GET (buffer + 12); if (sample_size == 0) { GST_LOG ("%*s n entries: %d\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + 16)); + QTDEMUX_GUINT32_GET (buffer + 16)); n = QTDEMUX_GUINT32_GET (buffer + 16); offset = 20; for (i = 0; i < n; i++) { GST_LOG ("%*s sample size: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); offset += 4; } @@ -1393,7 +1394,7 @@ qtdemux_dump_stco (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s chunk offset: %u\n", depth, "", - QTDEMUX_GUINT32_GET (buffer + offset)); + QTDEMUX_GUINT32_GET (buffer + offset)); offset += 4; } @@ -1414,7 +1415,7 @@ qtdemux_dump_co64 (GstQTDemux * qtdemux, void *buffer, int depth) offset = 16; for (i = 0; i < n; i++) { GST_LOG ("%*s chunk offset: %" G_GUINT64_FORMAT "\n", depth, "", - QTDEMUX_GUINT64_GET (buffer + offset)); + QTDEMUX_GUINT64_GET (buffer + offset)); offset += 8; } @@ -1569,58 +1570,58 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) if (stream->subtype == FOURCC_vide) { offset = 16; GST_LOG ("st type: " GST_FOURCC_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4))); stream->width = QTDEMUX_GUINT16_GET (stsd->data + offset + 32); stream->height = QTDEMUX_GUINT16_GET (stsd->data + offset + 34); - stream->fps = 0.; /* this is filled in later */ + stream->fps = 0.; /* this is filled in later */ GST_LOG ("frame count: %u\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 48)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 48)); stream->caps = qtdemux_video_caps (qtdemux, - QTDEMUX_FOURCC_GET (stsd->data + offset + 4), stsd->data); + QTDEMUX_FOURCC_GET (stsd->data + offset + 4), stsd->data); GST_INFO ("type " GST_FOURCC_FORMAT " caps %" GST_PTR_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4)), - stream->caps); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + offset + 4)), + stream->caps); } else if (stream->subtype == FOURCC_soun) { int version, samplesize; GST_LOG ("st type: " GST_FOURCC_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4))); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4))); offset = 32; GST_LOG ("version/rev: %08x\n", - QTDEMUX_GUINT32_GET (stsd->data + offset)); + QTDEMUX_GUINT32_GET (stsd->data + offset)); version = QTDEMUX_GUINT32_GET (stsd->data + offset); GST_LOG ("vendor: %08x\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); GST_LOG ("n_channels: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 8)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 8)); stream->n_channels = QTDEMUX_GUINT16_GET (stsd->data + offset + 8); GST_LOG ("sample_size: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 10)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 10)); samplesize = QTDEMUX_GUINT16_GET (stsd->data + offset + 10); GST_LOG ("compression_id: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 12)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 12)); GST_LOG ("packet size: %d\n", - QTDEMUX_GUINT16_GET (stsd->data + offset + 14)); + QTDEMUX_GUINT16_GET (stsd->data + offset + 14)); GST_LOG ("sample rate: %g\n", - QTDEMUX_FP32_GET (stsd->data + offset + 16)); + QTDEMUX_FP32_GET (stsd->data + offset + 16)); stream->rate = QTDEMUX_FP32_GET (stsd->data + offset + 16); offset = 52; if (version == 0x00010000) { GST_LOG ("samples/packet: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset)); + QTDEMUX_GUINT32_GET (stsd->data + offset)); stream->samples_per_packet = QTDEMUX_GUINT32_GET (stsd->data + offset); GST_LOG ("bytes/packet: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 4)); GST_LOG ("bytes/frame: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 8)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 8)); stream->bytes_per_frame = QTDEMUX_GUINT32_GET (stsd->data + offset + 8); GST_LOG ("bytes/sample: %d\n", - QTDEMUX_GUINT32_GET (stsd->data + offset + 12)); + QTDEMUX_GUINT32_GET (stsd->data + offset + 12)); offset = 68; } else { stream->bytes_per_frame = stream->n_channels * samplesize / 8; @@ -1628,12 +1629,12 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) } stream->caps = qtdemux_audio_caps (qtdemux, - QTDEMUX_FOURCC_GET (stsd->data + 16 + 4), - (QTDEMUX_GUINT32_GET (stsd->data) > - offset) ? stsd->data + offset : NULL); + QTDEMUX_FOURCC_GET (stsd->data + 16 + 4), + (QTDEMUX_GUINT32_GET (stsd->data) > + offset) ? stsd->data + offset : NULL); GST_INFO ("type " GST_FOURCC_FORMAT " caps %" GST_PTR_FORMAT "\n", - GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4)), - stream->caps); + GST_FOURCC_ARGS (QTDEMUX_FOURCC_GET (stsd->data + 16 + 4)), + stream->caps); } else { GST_LOG ("unknown subtype\n"); return; @@ -1672,28 +1673,28 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) first_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 0) - 1; if (i == n_samples_per_chunk - 1) { - last_chunk = INT_MAX; + last_chunk = INT_MAX; } else { - last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; + last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; } samples_per_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 4); for (j = first_chunk; j < last_chunk; j++) { - int chunk_offset; - - if (stco) { - chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); - } else { - chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); - } - for (k = 0; k < samples_per_chunk; k++) { - samples[index].chunk = j; - samples[index].offset = chunk_offset; - chunk_offset += samples[index].size; - index++; - if (index >= n_samples) - goto done; - } + int chunk_offset; + + if (stco) { + chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); + } else { + chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); + } + for (k = 0; k < samples_per_chunk; k++) { + samples[index].chunk = j; + samples[index].offset = chunk_offset; + chunk_offset += samples[index].size; + index++; + if (index >= n_samples) + goto done; + } } } done: @@ -1710,11 +1711,11 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) duration = QTDEMUX_GUINT32_GET (stts->data + 16 + 8 * i + 4); time = (GST_SECOND * duration) / stream->timescale; for (j = 0; j < n; j++) { - //GST_INFO("moo %lld", timestamp); - samples[index].timestamp = timestamp; - samples[index].duration = time; - timestamp += time; - index++; + //GST_INFO("moo %lld", timestamp); + samples[index].timestamp = timestamp; + samples[index].duration = time; + timestamp += time; + index++; } } } else { @@ -1744,40 +1745,40 @@ qtdemux_parse_trak (GstQTDemux * qtdemux, GNode * trak) first_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 0) - 1; if (i == n_samples - 1) { - last_chunk = INT_MAX; + last_chunk = INT_MAX; } else { - last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; + last_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 12) - 1; } samples_per_chunk = QTDEMUX_GUINT32_GET (stsc->data + 16 + i * 12 + 4); for (j = first_chunk; j < last_chunk; j++) { - int chunk_offset; - - if (j >= n_samples) - goto done2; - if (stco) { - chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); - } else { - chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); - } - samples[j].chunk = j; - samples[j].offset = chunk_offset; - samples[j].size = - samples_per_chunk * stream->bytes_per_frame / - stream->samples_per_packet; - samples[j].duration = - samples_per_chunk * GST_SECOND / (stream->rate / 2); - samples[j].timestamp = timestamp; - timestamp += (samples_per_chunk * GST_SECOND) / stream->rate; + int chunk_offset; + + if (j >= n_samples) + goto done2; + if (stco) { + chunk_offset = QTDEMUX_GUINT32_GET (stco->data + 16 + j * 4); + } else { + chunk_offset = QTDEMUX_GUINT64_GET (co64->data + 16 + j * 8); + } + samples[j].chunk = j; + samples[j].offset = chunk_offset; + samples[j].size = + samples_per_chunk * stream->bytes_per_frame / + stream->samples_per_packet; + samples[j].duration = + samples_per_chunk * GST_SECOND / (stream->rate / 2); + samples[j].timestamp = timestamp; + timestamp += (samples_per_chunk * GST_SECOND) / stream->rate; #if 0 - GST_INFO ("moo samples_per_chunk=%d rate=%d dur=%lld %lld", - (int) samples_per_chunk, - (int) stream->rate, - (long long) ((samples_per_chunk * GST_SECOND) / stream->rate), - (long long) timestamp); + GST_INFO ("moo samples_per_chunk=%d rate=%d dur=%lld %lld", + (int) samples_per_chunk, + (int) stream->rate, + (long long) ((samples_per_chunk * GST_SECOND) / stream->rate), + (long long) timestamp); #endif - samples[j].sample_index = sample_index; - sample_index += samples_per_chunk; + samples[j].sample_index = sample_index; + sample_index += samples_per_chunk; } } /* @@ -1809,8 +1810,8 @@ done2: #if 0 for (i = 0; i < n_samples; i++) { GST_LOG ("%d: %d %d %d %d %" G_GUINT64_FORMAT "\n", i, - samples[i].sample_index, samples[i].chunk, - samples[i].offset, samples[i].size, samples[i].timestamp); + samples[i].sample_index, samples[i].chunk, + samples[i].offset, samples[i].size, samples[i].timestamp); if (i > 10) break; } @@ -1836,53 +1837,53 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, return gst_caps_from_string ("image/jpeg"); case GST_MAKE_FOURCC ('S', 'V', 'Q', '3'): if (stsd_data != NULL) { - gst_getbits_t gb; - gint halfpel_flag; - gint thirdpel_flag; - gint unknown_svq3_flag; - gint low_delay; - gint size; + gst_getbits_t gb; + gint halfpel_flag; + gint thirdpel_flag; + gint unknown_svq3_flag; + gint low_delay; + gint size; - size = QTDEMUX_GUINT32_GET (stsd_data + 16); + size = QTDEMUX_GUINT32_GET (stsd_data + 16); - gst_getbits_init (&gb, NULL, NULL); - gst_getbits_newbuf (&gb, (unsigned char *) stsd_data + 98 + 16 + 4, - (size - 102 + 16)); + gst_getbits_init (&gb, NULL, NULL); + gst_getbits_newbuf (&gb, (unsigned char *) stsd_data + 98 + 16 + 4, + (size - 102 + 16)); - /* Infos ripped from ffmpeg see libavcodec/svq3.c */ + /* Infos ripped from ffmpeg see libavcodec/svq3.c */ - /* 'frame size code' and optional 'width, height' */ - if (gst_getbitsn (&gb, 3) == 7) { - gst_getbitsn (&gb, 12); - gst_getbitsn (&gb, 12); - } + /* 'frame size code' and optional 'width, height' */ + if (gst_getbitsn (&gb, 3) == 7) { + gst_getbitsn (&gb, 12); + gst_getbitsn (&gb, 12); + } - halfpel_flag = gst_get1bit (&gb); - thirdpel_flag = gst_get1bit (&gb); + halfpel_flag = gst_get1bit (&gb); + thirdpel_flag = gst_get1bit (&gb); - /* unknown fields */ - gst_get1bit (&gb); - gst_get1bit (&gb); - gst_get1bit (&gb); - gst_get1bit (&gb); + /* unknown fields */ + gst_get1bit (&gb); + gst_get1bit (&gb); + gst_get1bit (&gb); + gst_get1bit (&gb); - low_delay = gst_get1bit (&gb); + low_delay = gst_get1bit (&gb); - /* unknown field */ - gst_get1bit (&gb); + /* unknown field */ + gst_get1bit (&gb); - while (gst_get1bit (&gb)) { - gst_getbitsn (&gb, 8); - } + while (gst_get1bit (&gb)) { + gst_getbitsn (&gb, 8); + } - unknown_svq3_flag = gst_get1bit (&gb); + unknown_svq3_flag = gst_get1bit (&gb); - return gst_caps_new_simple ("video/x-svq", - "svqversion", G_TYPE_INT, 3, - "halfpel_flag", G_TYPE_INT, halfpel_flag, - "thirdpel_flag", G_TYPE_INT, thirdpel_flag, - "low_delay", G_TYPE_INT, low_delay, - "unknown_svq3_flag", G_TYPE_INT, unknown_svq3_flag, NULL); + return gst_caps_new_simple ("video/x-svq", + "svqversion", G_TYPE_INT, 3, + "halfpel_flag", G_TYPE_INT, halfpel_flag, + "thirdpel_flag", G_TYPE_INT, thirdpel_flag, + "low_delay", G_TYPE_INT, low_delay, + "unknown_svq3_flag", G_TYPE_INT, unknown_svq3_flag, NULL); } return gst_caps_from_string ("video/x-svq, " "svqversion = (int) 3"); case GST_MAKE_FOURCC ('s', 'v', 'q', 'i'): @@ -1891,7 +1892,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('r', 'a', 'w', ' '): /* uncompressed RGB */ return gst_caps_from_string ("video/x-raw-rgb, " - "endianness = (int) BIG_ENDIAN"); + "endianness = (int) BIG_ENDIAN"); /*"bpp", GST_PROPS_INT(x), "depth", GST_PROPS_INT(x), "red_mask", GST_PROPS_INT(x), @@ -1900,11 +1901,11 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('Y', 'u', 'v', '2'): /* uncompressed YUV2 */ return gst_caps_from_string ("video/x-raw-yuv, " - "format = (fourcc) YUY2"); + "format = (fourcc) YUY2"); case GST_MAKE_FOURCC ('m', 'p', 'e', 'g'): /* MPEG */ return gst_caps_from_string ("video/mpeg, " - "systemstream = (boolean) false, " "mpegversion = (int) 1"); + "systemstream = (boolean) false, " "mpegversion = (int) 1"); case GST_MAKE_FOURCC ('g', 'i', 'f', ' '): return gst_caps_from_string ("image/gif"); case GST_MAKE_FOURCC ('h', '2', '6', '3'): @@ -1914,7 +1915,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('m', 'p', '4', 'v'): /* MPEG-4 */ return gst_caps_from_string ("video/mpeg, " - "mpegversion = (int) 4, " "systemstream = (boolean) false"); + "mpegversion = (int) 4, " "systemstream = (boolean) false"); case GST_MAKE_FOURCC ('3', 'I', 'V', '1'): return gst_caps_from_string ("video/x-3ivx"); case GST_MAKE_FOURCC ('c', 'v', 'i', 'd'): @@ -1927,7 +1928,7 @@ qtdemux_video_caps (GstQTDemux * qtdemux, guint32 fourcc, case GST_MAKE_FOURCC ('k', 'p', 'c', 'd'): default: g_critical ("Don't know how to convert fourcc '" GST_FOURCC_FORMAT - "' to caps\n", GST_FOURCC_ARGS (fourcc)); + "' to caps\n", GST_FOURCC_ARGS (fourcc)); return NULL; } } @@ -1937,41 +1938,41 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) { switch (fourcc) { case GST_MAKE_FOURCC ('N', 'O', 'N', 'E'): - return NULL; /*gst_caps_from_string ("audio/raw"); */ + return NULL; /*gst_caps_from_string ("audio/raw"); */ case GST_MAKE_FOURCC ('r', 'a', 'w', ' '): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 8, " "depth = (int) 8, " "signed = (boolean) true"); + "width = (int) 8, " "depth = (int) 8, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('t', 'w', 'o', 's'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 16, " - "depth = (int) 16, " - "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); + "width = (int) 16, " + "depth = (int) 16, " + "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('s', 'o', 'w', 't'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 16, " - "depth = (int) 16, " - "endianness = (int) G_LITTLE_ENDIAN, " "signed = (boolean) true"); + "width = (int) 16, " + "depth = (int) 16, " + "endianness = (int) G_LITTLE_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('f', 'l', '6', '4'): return gst_caps_from_string ("audio/x-raw-float, " - "width = (int) 64, " "endianness = (int) G_BIG_ENDIAN"); + "width = (int) 64, " "endianness = (int) G_BIG_ENDIAN"); case GST_MAKE_FOURCC ('f', 'l', '3', '2'): return gst_caps_from_string ("audio/x-raw-float, " - "width = (int) 32, " "endianness = (int) G_BIG_ENDIAN"); + "width = (int) 32, " "endianness = (int) G_BIG_ENDIAN"); case GST_MAKE_FOURCC ('i', 'n', '2', '4'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 24, " - "depth = (int) 32, " - "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); + "width = (int) 24, " + "depth = (int) 32, " + "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('i', 'n', '3', '2'): /* FIXME */ return gst_caps_from_string ("audio/x-raw-int, " - "width = (int) 32, " - "depth = (int) 32, " - "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); + "width = (int) 32, " + "depth = (int) 32, " + "endianness = (int) G_BIG_ENDIAN, " "signed = (boolean) true"); case GST_MAKE_FOURCC ('u', 'l', 'a', 'w'): /* FIXME */ return gst_caps_from_string ("audio/x-mulaw"); @@ -1981,18 +1982,18 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) case 0x6d730002: /* Microsoft ADPCM-ACM code 2 */ return gst_caps_from_string ("audio/x-adpcm, " - "layout = (string) microsoft"); + "layout = (string) microsoft"); case 0x6d730011: /* FIXME DVI/Intel IMA ADPCM/ACM code 17 */ return gst_caps_from_string ("audio/x-adpcm, " - "layout = (string) quicktime"); + "layout = (string) quicktime"); case 0x6d730055: /* MPEG layer 3, CBR only (pre QT4.1) */ case 0x5500736d: case GST_MAKE_FOURCC ('.', 'm', 'p', '3'): /* MPEG layer 3, CBR & VBR (QT4.1 and later) */ return gst_caps_from_string ("audio/mpeg, " - "layer = (int) 3, " "mpegversion = (int) 1"); + "layer = (int) 3, " "mpegversion = (int) 1"); case GST_MAKE_FOURCC ('M', 'A', 'C', '3'): /* MACE 3:1 */ return gst_caps_from_string ("audio/x-mace, " "maceversion = (int) 3"); @@ -2011,11 +2012,11 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) case GST_MAKE_FOURCC ('Q', 'D', 'M', '2'): /* FIXME: QDesign music version 2 (no constant) */ if (QTDEMUX_GUINT32_GET (data) <= 100) { - gst_util_dump_mem ((guint8 *) data, 100); - return gst_caps_new_simple ("audio/x-qdm2", - "framesize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 52), - "bitrate", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 40), - "blocksize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 44), NULL); + gst_util_dump_mem ((guint8 *) data, 100); + return gst_caps_new_simple ("audio/x-qdm2", + "framesize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 52), + "bitrate", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 40), + "blocksize", G_TYPE_INT, QTDEMUX_GUINT32_GET (data + 44), NULL); } case GST_MAKE_FOURCC ('q', 't', 'v', 'r'): /* ? */ @@ -2029,7 +2030,7 @@ qtdemux_audio_caps (GstQTDemux * qtdemux, guint32 fourcc, const guint8 * data) /* ? */ default: g_critical ("Don't know how to convert fourcc '" GST_FOURCC_FORMAT - "' to caps\n", GST_FOURCC_ARGS (fourcc)); + "' to caps\n", GST_FOURCC_ARGS (fourcc)); return NULL; } } diff --git a/gst/rtjpeg/RTjpeg.c b/gst/rtjpeg/RTjpeg.c index d2e7b67d..f2f61252 100644 --- a/gst/rtjpeg/RTjpeg.c +++ b/gst/rtjpeg/RTjpeg.c @@ -147,7 +147,7 @@ RTjpeg_b2s (__s16 * data, __s8 * strm, __u8 bt8) strm[0] = (__u8) (data[RTjpeg_ZZ[0]] > 254) ? 254 : ((data[RTjpeg_ZZ[0]] < - 0) ? 0 : data[RTjpeg_ZZ[0]]); + 0) ? 0 : data[RTjpeg_ZZ[0]]); for (ci = 1; ci <= bt8; ci++) { ZZvalue = data[RTjpeg_ZZ[ci]]; @@ -166,11 +166,11 @@ RTjpeg_b2s (__s16 * data, __s8 * strm, __u8 bt8) strm[co++] = (__s8) (ZZvalue > 63) ? 63 : ZZvalue; } else if (ZZvalue < 0) { strm[co++] = (__s8) (ZZvalue < -64) ? -64 : ZZvalue; - } else { /* compress zeros */ + } else { /* compress zeros */ tmp = ci; do { - ci++; + ci++; } while ((ci < 64) && (data[RTjpeg_ZZ[ci]] == 0)); @@ -199,7 +199,7 @@ RTjpeg_s2b (__s16 * data, __s8 * strm, __u8 bt8, __u32 * qtbl) if (strm[ci] > 63) { tmp = co + strm[ci] - 63; for (; co < tmp; co++) - data[RTjpeg_ZZ[co]] = 0; + data[RTjpeg_ZZ[co]] = 0; co--; } else { i = RTjpeg_ZZ[co]; @@ -242,19 +242,19 @@ RTjpeg_quant (__s16 * block, __s32 * qtbl) movq_m2r (RTjpeg_half, mm7); for (i = 16; i; i--) { - movq_m2r (*(ql++), mm0); /* quant vals (4) */ - movq_m2r (*bl, mm2); /* block vals (4) */ + movq_m2r (*(ql++), mm0); /* quant vals (4) */ + movq_m2r (*bl, mm2); /* block vals (4) */ movq_r2r (mm0, mm1); movq_r2r (mm2, mm3); - punpcklwd_r2r (mm6, mm0); /* 1 qb 1 qa */ - punpckhwd_r2r (mm6, mm1); /* 1 qd 1 qc */ + punpcklwd_r2r (mm6, mm0); /* 1 qb 1 qa */ + punpckhwd_r2r (mm6, mm1); /* 1 qd 1 qc */ - punpcklwd_r2r (mm7, mm2); /* 32767 bb 32767 ba */ - punpckhwd_r2r (mm7, mm3); /* 32767 bd 32767 bc */ + punpcklwd_r2r (mm7, mm2); /* 32767 bb 32767 ba */ + punpckhwd_r2r (mm7, mm3); /* 32767 bd 32767 bc */ - pmaddwd_r2r (mm2, mm0); /* 32767+bb*qb 32767+ba*qa */ - pmaddwd_r2r (mm3, mm1); /* 32767+bd*qd 32767+bc*qc */ + pmaddwd_r2r (mm2, mm0); /* 32767+bb*qb 32767+ba*qa */ + pmaddwd_r2r (mm3, mm1); /* 32767+bd*qd 32767+bc*qc */ psrad_i2r (16, mm0); psrad_i2r (16, mm1); @@ -293,10 +293,10 @@ static mmx_t RTjpeg_zero = (mmx_t) (long long) 0x0000000000000000LL; #else -#define FIX_0_382683433 ((__s32) 98) /* FIX(0.382683433) */ -#define FIX_0_541196100 ((__s32) 139) /* FIX(0.541196100) */ -#define FIX_0_707106781 ((__s32) 181) /* FIX(0.707106781) */ -#define FIX_1_306562965 ((__s32) 334) /* FIX(1.306562965) */ +#define FIX_0_382683433 ((__s32) 98) /* FIX(0.382683433) */ +#define FIX_0_541196100 ((__s32) 139) /* FIX(0.541196100) */ +#define FIX_0_707106781 ((__s32) 181) /* FIX(0.707106781) */ +#define FIX_1_306562965 ((__s32) 334) /* FIX(1.306562965) */ #define DESCALE10(x) (__s16)( ((x)+128) >> 8) #define DESCALE20(x) (__s16)(((x)+32768) >> 16) @@ -338,36 +338,36 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) tmp3 = idataptr[3] + idataptr[4]; tmp4 = idataptr[3] - idataptr[4]; - tmp10 = (tmp0 + tmp3); /* phase 2 */ + tmp10 = (tmp0 + tmp3); /* phase 2 */ tmp13 = tmp0 - tmp3; tmp11 = (tmp1 + tmp2); tmp12 = tmp1 - tmp2; - wsptr[0] = (tmp10 + tmp11) << 8; /* phase 3 */ + wsptr[0] = (tmp10 + tmp11) << 8; /* phase 3 */ wsptr[4] = (tmp10 - tmp11) << 8; - z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ - wsptr[2] = (tmp13 << 8) + z1; /* phase 5 */ + z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ + wsptr[2] = (tmp13 << 8) + z1; /* phase 5 */ wsptr[6] = (tmp13 << 8) - z1; - tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp10 = tmp4 + tmp5; /* phase 2 */ tmp11 = tmp5 + tmp6; tmp12 = tmp6 + tmp7; - z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ + z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ - z11 = (tmp7 << 8) + z3; /* phase 5 */ + z11 = (tmp7 << 8) + z3; /* phase 5 */ z13 = (tmp7 << 8) - z3; - wsptr[5] = z13 + z2; /* phase 6 */ + wsptr[5] = z13 + z2; /* phase 6 */ wsptr[3] = z13 - z2; wsptr[1] = z11 + z4; wsptr[7] = z11 - z4; - idataptr += rskip << 3; /* advance pointer to next row */ + idataptr += rskip << 3; /* advance pointer to next row */ wsptr += 8; } @@ -383,36 +383,36 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) tmp3 = wsptr[24] + wsptr[32]; tmp4 = wsptr[24] - wsptr[32]; - tmp10 = tmp0 + tmp3; /* phase 2 */ + tmp10 = tmp0 + tmp3; /* phase 2 */ tmp13 = tmp0 - tmp3; tmp11 = tmp1 + tmp2; tmp12 = tmp1 - tmp2; - odataptr[0] = DESCALE10 (tmp10 + tmp11); /* phase 3 */ + odataptr[0] = DESCALE10 (tmp10 + tmp11); /* phase 3 */ odataptr[32] = DESCALE10 (tmp10 - tmp11); - z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ - odataptr[16] = DESCALE20 ((tmp13 << 8) + z1); /* phase 5 */ + z1 = D_MULTIPLY (tmp12 + tmp13, FIX_0_707106781); /* c4 */ + odataptr[16] = DESCALE20 ((tmp13 << 8) + z1); /* phase 5 */ odataptr[48] = DESCALE20 ((tmp13 << 8) - z1); - tmp10 = tmp4 + tmp5; /* phase 2 */ + tmp10 = tmp4 + tmp5; /* phase 2 */ tmp11 = tmp5 + tmp6; tmp12 = tmp6 + tmp7; - z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ - z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ - z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ - z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ + z5 = D_MULTIPLY (tmp10 - tmp12, FIX_0_382683433); /* c6 */ + z2 = D_MULTIPLY (tmp10, FIX_0_541196100) + z5; /* c2-c6 */ + z4 = D_MULTIPLY (tmp12, FIX_1_306562965) + z5; /* c2+c6 */ + z3 = D_MULTIPLY (tmp11, FIX_0_707106781); /* c4 */ - z11 = (tmp7 << 8) + z3; /* phase 5 */ + z11 = (tmp7 << 8) + z3; /* phase 5 */ z13 = (tmp7 << 8) - z3; - odataptr[40] = DESCALE20 (z13 + z2); /* phase 6 */ + odataptr[40] = DESCALE20 (z13 + z2); /* phase 6 */ odataptr[24] = DESCALE20 (z13 - z2); odataptr[8] = DESCALE20 (z11 + z4); odataptr[56] = DESCALE20 (z11 - z4); - odataptr++; /* advance pointer to next column */ + odataptr++; /* advance pointer to next column */ wsptr++; } #else @@ -513,169 +513,169 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) /* Start Transpose to do calculations on rows */ - movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into m5 */ + movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into m5 */ - movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ + movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ movq_r2r (mm7, mm5); - punpcklwd_m2r (*(dataptr + 11), mm7); /* m11:m01|m10:m00 - interleave first and second lines */ + punpcklwd_m2r (*(dataptr + 11), mm7); /* m11:m01|m10:m00 - interleave first and second lines */ movq_r2r (mm6, mm2); - punpcklwd_m2r (*(dataptr + 15), mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 15), mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ movq_r2r (mm7, mm1); - movq_m2r (*(dataptr + 11), mm3); /* m13:m13|m11:m10 - second line */ - punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ + movq_m2r (*(dataptr + 11), mm3); /* m13:m13|m11:m10 - second line */ + punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ - movq_m2r (*(dataptr + 15), mm0); /* m13:m13|m11:m10 - fourth line */ - punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + movq_m2r (*(dataptr + 15), mm0); /* m13:m13|m11:m10 - fourth line */ + punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ - punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ + punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ - punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ + punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ movq_r2r (mm5, mm1); - punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ + punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ - movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ - punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ + movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ + punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ - movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ + movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ /* last 4x4 done */ - movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ + movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ - movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ + movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ movq_r2r (mm0, mm6); - punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ movq_r2r (mm2, mm7); - punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ movq_r2r (mm0, mm4); - movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ - punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ + movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ + punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ - movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ - punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ + movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ + punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ - punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2r (mm1, mm2); /* copy first line */ + punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm1, mm2); /* copy first line */ - punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ - movq_r2r (mm6, mm5); /* copy first intermediate result */ + punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2r (mm6, mm5); /* copy first intermediate result */ - movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ - punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ + movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ + punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ - punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ - movq_r2r (mm3, mm0); /* copy third line */ + punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ + movq_r2r (mm3, mm0); /* copy third line */ - punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ + punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ - movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ - punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ + punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ - punpcklwd_m2r (*(dataptr + 14), mm3); /* n31:n21|n30:n20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 14), mm3); /* n31:n21|n30:n20 - interleave third and fourth lines */ movq_r2r (mm1, mm4); - movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ - punpckldq_r2r (mm3, mm1); /* n30:n20|n10:n00 - produce first result */ + movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ + punpckldq_r2r (mm3, mm1); /* n30:n20|n10:n00 - produce first result */ - punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ + punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ movq_r2r (mm2, mm6); - movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ - punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ + movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ + punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ - movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ - punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ + movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ + punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ - movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ - punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ + punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ - movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ + movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ - movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ + movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ - movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ + movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ /* Do first 4x4 quadrant, which is used in the beginning of the DCT: */ - movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ + movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ movq_r2r (mm0, mm2); - punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ movq_r2r (mm7, mm4); - punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ + punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ movq_r2r (mm0, mm1); - movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ - punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ + movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ + punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ - movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ - punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ + punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2r (mm0, mm7); /* write result 1 */ - punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm0, mm7); /* write result 1 */ + punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ - psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ - movq_r2r (mm1, mm6); /* write result 2 */ + psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ + movq_r2r (mm1, mm6); /* write result 2 */ - paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ - punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ + paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ + punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ - paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ - movq_r2r (mm2, mm3); /* copy first intermediate result */ + paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ + movq_r2r (mm2, mm3); /* copy first intermediate result */ - psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ - punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ + psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ + punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ movq_r2m (mm7, tmp7); - movq_r2r (mm2, mm5); /* write result 3 */ + movq_r2r (mm2, mm5); /* write result 3 */ movq_r2m (mm6, tmp6); - punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ + punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ - paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+5: Stage 1 */ - movq_r2r (mm3, mm4); /* write result 4 */ + paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+5: Stage 1 */ + movq_r2r (mm3, mm4); /* write result 4 */ /************************************************************************************************ End of Transpose ************************************************************************************************/ - paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ + paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ movq_r2r (mm0, mm7); - psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ + psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ movq_r2r (mm1, mm6); - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ - psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3 */ movq_m2r (tmp6, mm2); movq_r2r (mm0, mm3); - psllw_i2r (2, mm6); /* m8 * 2^2 */ + psllw_i2r (2, mm6); /* m8 * 2^2 */ paddw_r2r (mm1, mm0); - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ psubw_r2r (mm1, mm3); movq_r2m (mm0, *dataptr); @@ -683,349 +683,349 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) /* Odd part */ movq_r2m (mm3, *(dataptr + 8)); - paddw_r2r (mm5, mm4); /* tmp10 */ + paddw_r2r (mm5, mm4); /* tmp10 */ movq_m2r (tmp7, mm3); - paddw_r2r (mm6, mm0); /* tmp32 */ + paddw_r2r (mm6, mm0); /* tmp32 */ - paddw_r2r (mm2, mm5); /* tmp11 */ - psubw_r2r (mm6, mm7); /* tmp33 */ + paddw_r2r (mm2, mm5); /* tmp11 */ + psubw_r2r (mm6, mm7); /* tmp33 */ movq_r2m (mm0, *(dataptr + 4)); - paddw_r2r (mm3, mm2); /* tmp12 */ + paddw_r2r (mm3, mm2); /* tmp12 */ /* stage 4 */ movq_r2m (mm7, *(dataptr + 12)); - movq_r2r (mm4, mm1); /* copy of tmp10 */ + movq_r2r (mm4, mm1); /* copy of tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* m8 * 2^2 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* m8 * 2^2 */ movq_m2r (RTjpeg_C2mC6, mm0); psllw_i2r (2, mm1); - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ psllw_i2r (2, mm2); - pmulhw_r2r (mm0, mm4); /* z5 */ + pmulhw_r2r (mm0, mm4); /* z5 */ /* stage 5 */ pmulhw_m2r (RTjpeg_C2pC6, mm2); psllw_i2r (2, mm5); - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + movq_r2r (mm3, mm0); /* copy tmp7 */ movq_m2r (*(dataptr + 1), mm7); - paddw_r2r (mm1, mm4); /* z2 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm1, mm2); /* z4 */ + paddw_r2r (mm1, mm2); /* z4 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ + movq_r2r (mm3, mm5); /* copy z13 */ + psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ - paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ - movq_r2r (mm0, mm6); /* copy z11 */ + paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ + movq_r2r (mm0, mm6); /* copy z11 */ - movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ - psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ + movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ + psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ - movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ - paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ + movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ + paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ - movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ + movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ - /************************************************ + /************************************************ * End of 1st 4 rows ************************************************/ - movq_m2r (*(dataptr + 3), mm1); /* load x1: stage 1 */ - movq_r2r (mm7, mm0); /* copy x0 */ + movq_m2r (*(dataptr + 3), mm1); /* load x1: stage 1 */ + movq_r2r (mm7, mm0); /* copy x0 */ - movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ + movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ - movq_m2r (*(dataptr + 5), mm2); /* load x2: stage 1 */ - movq_r2r (mm1, mm6); /* copy x1 */ + movq_m2r (*(dataptr + 5), mm2); /* load x2: stage 1 */ + movq_r2r (mm1, mm6); /* copy x1 */ - paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ + paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ - movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ - movq_r2r (mm2, mm5); /* copy x2 */ + movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ + movq_r2r (mm2, mm5); /* copy x2 */ - psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ - movq_r2r (mm3, mm4); /* copy x3 */ + psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ + movq_r2r (mm3, mm4); /* copy x3 */ - paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ + paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ - movq_r2m (mm7, tmp7); /* save tmp07 */ - movq_r2r (mm0, mm7); /* copy tmp00 */ + movq_r2m (mm7, tmp7); /* save tmp07 */ + movq_r2r (mm0, mm7); /* copy tmp00 */ - psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ + psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ /* stage 2, Even Part */ - paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ + paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ - movq_r2m (mm6, tmp6); /* save tmp07 */ - movq_r2r (mm1, mm6); /* copy tmp01 */ + movq_r2m (mm6, tmp6); /* save tmp07 */ + movq_r2r (mm1, mm6); /* copy tmp01 */ - paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ + paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ - psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ + psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ - psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3, Even and stage 4 & 5 even */ - movq_m2r (tmp6, mm2); /* load tmp6 */ - movq_r2r (mm0, mm3); /* copy tmp10 */ + movq_m2r (tmp6, mm2); /* load tmp6 */ + movq_r2r (mm0, mm3); /* copy tmp10 */ - psllw_i2r (2, mm6); /* shift z1 */ - paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ + psllw_i2r (2, mm6); /* shift z1 */ + paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ - psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ - movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ - movq_r2r (mm7, mm0); /* copy tmp13 */ + movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ + movq_r2r (mm7, mm0); /* copy tmp13 */ /* odd part */ - movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ - paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ + movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ + paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ - movq_m2r (tmp7, mm3); /* load tmp7 */ - paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ + movq_m2r (tmp7, mm3); /* load tmp7 */ + paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ - paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ - psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ + paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ + psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ - movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ - paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ + movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ + paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ /* stage 4 */ - movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ - movq_r2r (mm4, mm1); /* copy tmp10 */ + movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ + movq_r2r (mm4, mm1); /* copy tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* shift tmp10 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* shift tmp10 */ - movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ - psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ + movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ + psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ - psllw_i2r (2, mm5); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + psllw_i2r (2, mm5); /* prepare for multiply */ - pmulhw_r2r (mm0, mm4); /* multiply by converted real */ + pmulhw_r2r (mm0, mm4); /* multiply by converted real */ /* stage 5 */ - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - psllw_i2r (2, mm2); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + psllw_i2r (2, mm2); /* prepare for multiply */ - pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ + movq_r2r (mm3, mm0); /* copy tmp7 */ - movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ - paddw_r2r (mm1, mm4); /* z2 */ + movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - paddw_r2r (mm1, mm2); /* z4 */ + movq_r2r (mm3, mm5); /* copy z13 */ + paddw_r2r (mm1, mm2); /* z4 */ - movq_r2r (mm0, mm6); /* copy z11 */ - psubw_r2r (mm4, mm5); /* y3 */ + movq_r2r (mm0, mm6); /* copy z11 */ + psubw_r2r (mm4, mm5); /* y3 */ - paddw_r2r (mm2, mm6); /* y1 */ - paddw_r2r (mm4, mm3); /* y5 */ + paddw_r2r (mm2, mm6); /* y1 */ + paddw_r2r (mm4, mm3); /* y5 */ - movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ + movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ - movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ - psubw_r2r (mm2, mm0); /* y7 */ + movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ + psubw_r2r (mm2, mm0); /* y7 */ /************************************************************************************************ Start of Transpose ************************************************************************************************/ - movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ - movq_r2r (mm7, mm5); /* copy first line */ + movq_m2r (*(dataptr + 13), mm6); /* m23:m22|m21:m20 - third line (line 6)and copy into m2 */ + movq_r2r (mm7, mm5); /* copy first line */ - punpcklwd_r2r (mm3, mm7); /* m11:m01|m10:m00 - interleave first and second lines */ - movq_r2r (mm6, mm2); /* copy third line */ + punpcklwd_r2r (mm3, mm7); /* m11:m01|m10:m00 - interleave first and second lines */ + movq_r2r (mm6, mm2); /* copy third line */ - punpcklwd_r2r (mm0, mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ - movq_r2r (mm7, mm1); /* copy first intermediate result */ + punpcklwd_r2r (mm0, mm6); /* m31:m21|m30:m20 - interleave third and fourth lines */ + movq_r2r (mm7, mm1); /* copy first intermediate result */ - punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ + punpckldq_r2r (mm6, mm7); /* m30:m20|m10:m00 - interleave to produce result 1 */ - punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + punpckhdq_r2r (mm6, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ - punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2m (mm7, *(dataptr + 9)); /* write result 1 */ + punpckhwd_r2r (mm3, mm5); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ - punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2m (mm1, *(dataptr + 11)); /* write result 2 */ + punpckhwd_r2r (mm0, mm2); /* m33:m23|m32:m22 - interleave third and fourth lines */ - movq_r2r (mm5, mm1); /* copy first intermediate result */ - punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ + movq_r2r (mm5, mm1); /* copy first intermediate result */ + punpckldq_r2r (mm2, mm5); /* m32:m22|m12:m02 - interleave to produce result 3 */ - movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ - punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ + movq_m2r (*(dataptr + 1), mm0); /* m03:m02|m01:m00 - first line, 4x4 */ + punpckhdq_r2r (mm2, mm1); /* m33:m23|m13:m03 - interleave to produce result 4 */ - movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ + movq_r2m (mm5, *(dataptr + 13)); /* write result 3 */ - /****** last 4x4 done */ + /****** last 4x4 done */ - movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ + movq_r2m (mm1, *(dataptr + 15)); /* write result 4, last 4x4 */ - movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ - movq_r2r (mm0, mm6); /* copy first line */ + movq_m2r (*(dataptr + 5), mm2); /* m23:m22|m21:m20 - third line */ + movq_r2r (mm0, mm6); /* copy first line */ - punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ - movq_r2r (mm2, mm7); /* copy third line */ + punpcklwd_m2r (*(dataptr + 3), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + movq_r2r (mm2, mm7); /* copy third line */ - punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ - movq_r2r (mm0, mm4); /* copy first intermediate result */ + punpcklwd_m2r (*(dataptr + 7), mm2); /* m31:m21|m30:m20 - interleave third and fourth lines */ + movq_r2r (mm0, mm4); /* copy first intermediate result */ - movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ - punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ + movq_m2r (*(dataptr + 8), mm1); /* n03:n02|n01:n00 - first line */ + punpckldq_r2r (mm2, mm0); /* m30:m20|m10:m00 - interleave to produce first result */ - movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ - punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ + movq_m2r (*(dataptr + 12), mm3); /* n23:n22|n21:n20 - third line */ + punpckhdq_r2r (mm2, mm4); /* m31:m21|m11:m01 - interleave to produce second result */ - punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ - movq_r2r (mm1, mm2); /* copy first line */ + punpckhwd_m2r (*(dataptr + 3), mm6); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm1, mm2); /* copy first line */ - punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ - movq_r2r (mm6, mm5); /* copy first intermediate result */ + punpckhwd_m2r (*(dataptr + 7), mm7); /* m33:m23|m32:m22 - interleave third and fourth lines */ + movq_r2r (mm6, mm5); /* copy first intermediate result */ - movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ - punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ + movq_r2m (mm0, *(dataptr + 8)); /* write result 1 */ + punpckhdq_r2r (mm7, mm5); /* m33:m23|m13:m03 - produce third result */ - punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ - movq_r2r (mm3, mm0); /* copy third line */ + punpcklwd_m2r (*(dataptr + 10), mm1); /* n11:n01|n10:n00 - interleave first and second lines */ + movq_r2r (mm3, mm0); /* copy third line */ - punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ + punpckhwd_m2r (*(dataptr + 10), mm2); /* n13:n03|n12:n02 - interleave first and second lines */ - movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ - punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 10)); /* write result 2 out */ + punpckldq_r2r (mm7, mm6); /* m32:m22|m12:m02 - produce fourth result */ - punpcklwd_m2r (*(dataptr + 14), mm3); /* n33:n23|n32:n22 - interleave third and fourth lines */ - movq_r2r (mm1, mm4); /* copy second intermediate result */ + punpcklwd_m2r (*(dataptr + 14), mm3); /* n33:n23|n32:n22 - interleave third and fourth lines */ + movq_r2r (mm1, mm4); /* copy second intermediate result */ - movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ - punpckldq_r2r (mm3, mm1); /* */ + movq_r2m (mm6, *(dataptr + 12)); /* write result 3 out */ + punpckldq_r2r (mm3, mm1); /* */ - punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ - movq_r2r (mm2, mm6); /* copy second intermediate result */ + punpckhwd_m2r (*(dataptr + 14), mm0); /* n33:n23|n32:n22 - interleave third and fourth lines */ + movq_r2r (mm2, mm6); /* copy second intermediate result */ - movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ - punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ + movq_r2m (mm5, *(dataptr + 14)); /* write result 4 out */ + punpckhdq_r2r (mm3, mm4); /* n31:n21|n11:n01- produce second result */ - movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ - punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ + movq_r2m (mm1, *(dataptr + 1)); /* write result 5 out - (first result for other 4 x 4 block) */ + punpckldq_r2r (mm0, mm2); /* n32:n22|n12:n02- produce third result */ - movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ - punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ + movq_r2m (mm4, *(dataptr + 3)); /* write result 6 out */ + punpckhdq_r2r (mm0, mm6); /* n33:n23|n13:n03 - produce fourth result */ - movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ + movq_r2m (mm2, *(dataptr + 5)); /* write result 7 out */ - movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ + movq_m2r (*dataptr, mm0); /* m03:m02|m01:m00 - first line, first 4x4 */ - movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ + movq_r2m (mm6, *(dataptr + 7)); /* write result 8 out */ /* Do first 4x4 quadrant, which is used in the beginning of the DCT: */ - movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ - movq_r2r (mm0, mm2); /* copy first line */ + movq_m2r (*(dataptr + 4), mm7); /* m23:m22|m21:m20 - third line */ + movq_r2r (mm0, mm2); /* copy first line */ - punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ - movq_r2r (mm7, mm4); /* copy third line */ + punpcklwd_m2r (*(dataptr + 2), mm0); /* m11:m01|m10:m00 - interleave first and second lines */ + movq_r2r (mm7, mm4); /* copy third line */ - punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ - movq_r2r (mm0, mm1); /* copy first intermediate result */ + punpcklwd_m2r (*(dataptr + 6), mm7); /* m31:m21|m30:m20 - interleave third and fourth lines */ + movq_r2r (mm0, mm1); /* copy first intermediate result */ - movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ - punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ + movq_m2r (*(dataptr + 2), mm6); /* m13:m12|m11:m10 - second line */ + punpckldq_r2r (mm7, mm0); /* m30:m20|m10:m00 - interleave to produce result 1 */ - movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ - punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ + movq_m2r (*(dataptr + 6), mm5); /* m33:m32|m31:m30 - fourth line */ + punpckhdq_r2r (mm7, mm1); /* m31:m21|m11:m01 - interleave to produce result 2 */ - movq_r2r (mm0, mm7); /* write result 1 */ - punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ + movq_r2r (mm0, mm7); /* write result 1 */ + punpckhwd_r2r (mm6, mm2); /* m13:m03|m12:m02 - interleave first and second lines */ - psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ - movq_r2r (mm1, mm6); /* write result 2 */ + psubw_m2r (*(dataptr + 14), mm7); /* tmp07=x0-x7: Stage 1 */ + movq_r2r (mm1, mm6); /* write result 2 */ - paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ - punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ + paddw_m2r (*(dataptr + 14), mm0); /* tmp00=x0+x7: Stage 1 */ + punpckhwd_r2r (mm5, mm4); /* m33:m23|m32:m22 - interleave third and fourth lines */ - paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ - movq_r2r (mm2, mm3); /* copy first intermediate result */ + paddw_m2r (*(dataptr + 12), mm1); /* tmp01=x1+x6: Stage 1 */ + movq_r2r (mm2, mm3); /* copy first intermediate result */ - psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ - punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ + psubw_m2r (*(dataptr + 12), mm6); /* tmp06=x1-x6: Stage 1 */ + punpckldq_r2r (mm4, mm2); /* m32:m22|m12:m02 - interleave to produce result 3 */ - movq_r2m (mm7, tmp7); /* save tmp07 */ - movq_r2r (mm2, mm5); /* write result 3 */ + movq_r2m (mm7, tmp7); /* save tmp07 */ + movq_r2r (mm2, mm5); /* write result 3 */ - movq_r2m (mm6, tmp6); /* save tmp06 */ + movq_r2m (mm6, tmp6); /* save tmp06 */ - punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ + punpckhdq_r2r (mm4, mm3); /* m33:m23|m13:m03 - interleave to produce result 4 */ - paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+x5: stage 1 */ - movq_r2r (mm3, mm4); /* write result 4 */ + paddw_m2r (*(dataptr + 10), mm2); /* tmp02=x2+x5: stage 1 */ + movq_r2r (mm3, mm4); /* write result 4 */ /************************************************************************************************ End of Transpose 2 ************************************************************************************************/ - paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ + paddw_m2r (*(dataptr + 8), mm3); /* tmp03=x3+x4: stage 1 */ movq_r2r (mm0, mm7); - psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ + psubw_m2r (*(dataptr + 8), mm4); /* tmp04=x3-x4: stage 1 */ movq_r2r (mm1, mm6); - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03: even 2 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03: even 2 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02: even 2 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02: even 2 */ - psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 10), mm5); /* tmp05=x2-x5: stage 1 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3 */ movq_m2r (tmp6, mm2); movq_r2r (mm0, mm3); - psllw_i2r (2, mm6); /* m8 * 2^2 */ + psllw_i2r (2, mm6); /* m8 * 2^2 */ paddw_r2r (mm1, mm0); - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ psubw_r2r (mm1, mm3); movq_r2m (mm0, *dataptr); @@ -1033,197 +1033,197 @@ RTjpeg_dctY (__u8 * idata, __s16 * odata, int rskip) /* Odd part */ movq_r2m (mm3, *(dataptr + 8)); - paddw_r2r (mm5, mm4); /* tmp10 */ + paddw_r2r (mm5, mm4); /* tmp10 */ movq_m2r (tmp7, mm3); - paddw_r2r (mm6, mm0); /* tmp32 */ + paddw_r2r (mm6, mm0); /* tmp32 */ - paddw_r2r (mm2, mm5); /* tmp11 */ - psubw_r2r (mm6, mm7); /* tmp33 */ + paddw_r2r (mm2, mm5); /* tmp11 */ + psubw_r2r (mm6, mm7); /* tmp33 */ movq_r2m (mm0, *(dataptr + 4)); - paddw_r2r (mm3, mm2); /* tmp12 */ + paddw_r2r (mm3, mm2); /* tmp12 */ /* stage 4 */ movq_r2m (mm7, *(dataptr + 12)); - movq_r2r (mm4, mm1); /* copy of tmp10 */ + movq_r2r (mm4, mm1); /* copy of tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* m8 * 2^2 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* m8 * 2^2 */ movq_m2r (RTjpeg_C2mC6, mm0); psllw_i2r (2, mm1); - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ psllw_i2r (2, mm2); - pmulhw_r2r (mm0, mm4); /* z5 */ + pmulhw_r2r (mm0, mm4); /* z5 */ /* stage 5 */ pmulhw_m2r (RTjpeg_C2pC6, mm2); psllw_i2r (2, mm5); - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + movq_r2r (mm3, mm0); /* copy tmp7 */ movq_m2r (*(dataptr + 1), mm7); - paddw_r2r (mm1, mm4); /* z2 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm1, mm2); /* z4 */ + paddw_r2r (mm1, mm2); /* z4 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ + movq_r2r (mm3, mm5); /* copy z13 */ + psubw_r2r (mm4, mm3); /* y3=z13 - z2 */ - paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ - movq_r2r (mm0, mm6); /* copy z11 */ + paddw_r2r (mm4, mm5); /* y5=z13 + z2 */ + movq_r2r (mm0, mm6); /* copy z11 */ - movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ - psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ + movq_r2m (mm3, *(dataptr + 6)); /*save y3 */ + psubw_r2r (mm2, mm0); /* y7=z11 - z4 */ - movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ - paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ + movq_r2m (mm5, *(dataptr + 10)); /*save y5 */ + paddw_r2r (mm2, mm6); /* y1=z11 + z4 */ - movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ + movq_r2m (mm0, *(dataptr + 14)); /*save y7 */ - /************************************************ + /************************************************ * End of 1st 4 rows ************************************************/ - movq_m2r (*(dataptr + 3), mm1); /* load x1 : stage 1 */ - movq_r2r (mm7, mm0); /* copy x0 */ + movq_m2r (*(dataptr + 3), mm1); /* load x1 : stage 1 */ + movq_r2r (mm7, mm0); /* copy x0 */ - movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ + movq_r2m (mm6, *(dataptr + 2)); /*save y1 */ - movq_m2r (*(dataptr + 5), mm2); /* load x2 : stage 1 */ - movq_r2r (mm1, mm6); /* copy x1 */ + movq_m2r (*(dataptr + 5), mm2); /* load x2 : stage 1 */ + movq_r2r (mm1, mm6); /* copy x1 */ - paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ + paddw_m2r (*(dataptr + 15), mm0); /* tmp00 = x0 + x7 */ - movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ - movq_r2r (mm2, mm5); /* copy x2 */ + movq_m2r (*(dataptr + 7), mm3); /* load x3 : stage 1 */ + movq_r2r (mm2, mm5); /* copy x2 */ - psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ - movq_r2r (mm3, mm4); /* copy x3 */ + psubw_m2r (*(dataptr + 15), mm7); /* tmp07 = x0 - x7 */ + movq_r2r (mm3, mm4); /* copy x3 */ - paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ + paddw_m2r (*(dataptr + 13), mm1); /* tmp01 = x1 + x6 */ - movq_r2m (mm7, tmp7); /* save tmp07 */ - movq_r2r (mm0, mm7); /* copy tmp00 */ + movq_r2m (mm7, tmp7); /* save tmp07 */ + movq_r2r (mm0, mm7); /* copy tmp00 */ - psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ + psubw_m2r (*(dataptr + 13), mm6); /* tmp06 = x1 - x6 */ /* stage 2, Even Part */ - paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ + paddw_m2r (*(dataptr + 9), mm3); /* tmp03 = x3 + x4 */ - movq_r2m (mm6, tmp6); /* save tmp07 */ - movq_r2r (mm1, mm6); /* copy tmp01 */ + movq_r2m (mm6, tmp6); /* save tmp07 */ + movq_r2r (mm1, mm6); /* copy tmp01 */ - paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ - paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ + paddw_m2r (*(dataptr + 11), mm2); /* tmp02 = x2 + x5 */ + paddw_r2r (mm3, mm0); /* tmp10 = tmp00 + tmp03 */ - psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ + psubw_r2r (mm3, mm7); /* tmp13 = tmp00 - tmp03 */ - psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ - psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ + psubw_m2r (*(dataptr + 9), mm4); /* tmp04 = x3 - x4 */ + psubw_r2r (mm2, mm6); /* tmp12 = tmp01 - tmp02 */ - paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ + paddw_r2r (mm2, mm1); /* tmp11 = tmp01 + tmp02 */ - psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ - paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ + psubw_m2r (*(dataptr + 11), mm5); /* tmp05 = x2 - x5 */ + paddw_r2r (mm7, mm6); /* tmp12 + tmp13 */ /* stage 3, Even and stage 4 & 5 even */ - movq_m2r (tmp6, mm2); /* load tmp6 */ - movq_r2r (mm0, mm3); /* copy tmp10 */ + movq_m2r (tmp6, mm2); /* load tmp6 */ + movq_r2r (mm0, mm3); /* copy tmp10 */ - psllw_i2r (2, mm6); /* shift z1 */ - paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ + psllw_i2r (2, mm6); /* shift z1 */ + paddw_r2r (mm1, mm0); /* y0=tmp10 + tmp11 */ - pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ - psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ + pmulhw_m2r (RTjpeg_C4, mm6); /* z1 */ + psubw_r2r (mm1, mm3); /* y4=tmp10 - tmp11 */ - movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ - movq_r2r (mm7, mm0); /* copy tmp13 */ + movq_r2m (mm0, *(dataptr + 1)); /*save y0 */ + movq_r2r (mm7, mm0); /* copy tmp13 */ /* odd part */ - movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ - paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ + movq_r2m (mm3, *(dataptr + 9)); /*save y4 */ + paddw_r2r (mm5, mm4); /* tmp10 = tmp4 + tmp5 */ - movq_m2r (tmp7, mm3); /* load tmp7 */ - paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ + movq_m2r (tmp7, mm3); /* load tmp7 */ + paddw_r2r (mm6, mm0); /* tmp32 = tmp13 + z1 */ - paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ - psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ + paddw_r2r (mm2, mm5); /* tmp11 = tmp5 + tmp6 */ + psubw_r2r (mm6, mm7); /* tmp33 = tmp13 - z1 */ - movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ - paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ + movq_r2m (mm0, *(dataptr + 5)); /*save y2 */ + paddw_r2r (mm3, mm2); /* tmp12 = tmp6 + tmp7 */ /* stage 4 */ - movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ - movq_r2r (mm4, mm1); /* copy tmp10 */ + movq_r2m (mm7, *(dataptr + 13)); /*save y6 */ + movq_r2r (mm4, mm1); /* copy tmp10 */ - psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ - psllw_i2r (2, mm4); /* shift tmp10 */ + psubw_r2r (mm2, mm1); /* tmp10 - tmp12 */ + psllw_i2r (2, mm4); /* shift tmp10 */ - movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ - psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ + movq_m2r (RTjpeg_C2mC6, mm0); /* load C2mC6 */ + psllw_i2r (2, mm1); /* shift (tmp10-tmp12) */ - pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ - psllw_i2r (2, mm5); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C6, mm1); /* z5 */ + psllw_i2r (2, mm5); /* prepare for multiply */ - pmulhw_r2r (mm0, mm4); /* multiply by converted real */ + pmulhw_r2r (mm0, mm4); /* multiply by converted real */ /* stage 5 */ - pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ - psllw_i2r (2, mm2); /* prepare for multiply */ + pmulhw_m2r (RTjpeg_C4, mm5); /* z3 */ + psllw_i2r (2, mm2); /* prepare for multiply */ - pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ - movq_r2r (mm3, mm0); /* copy tmp7 */ + pmulhw_m2r (RTjpeg_C2pC6, mm2); /* multiply */ + movq_r2r (mm3, mm0); /* copy tmp7 */ - movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ - paddw_r2r (mm1, mm4); /* z2 */ + movq_m2r (*(dataptr + 9), mm7); /* m03:m02|m01:m00 - first line (line 4)and copy into mm7 */ + paddw_r2r (mm1, mm4); /* z2 */ - paddw_r2r (mm5, mm0); /* z11 */ - psubw_r2r (mm5, mm3); /* z13 */ + paddw_r2r (mm5, mm0); /* z11 */ + psubw_r2r (mm5, mm3); /* z13 */ /* stage 6 */ - movq_r2r (mm3, mm5); /* copy z13 */ - paddw_r2r (mm1, mm2); /* z4 */ + movq_r2r (mm3, mm5); /* copy z13 */ + paddw_r2r (mm1, mm2); /* z4 */ - movq_r2r (mm0, mm6); /* copy z11 */ - psubw_r2r (mm4, mm5); /* y3 */ + movq_r2r (mm0, mm6); /* copy z11 */ + psubw_r2r (mm4, mm5); /* y3 */ - paddw_r2r (mm2, mm6); /* y1 */ - paddw_r2r (mm4, mm3); /* y5 */ + paddw_r2r (mm2, mm6); /* y1 */ + paddw_r2r (mm4, mm3); /* y5 */ - movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ - psubw_r2r (mm2, mm0); /* yè=z11 - z4 */ + movq_r2m (mm5, *(dataptr + 7)); /*save y3 */ + psubw_r2r (mm2, mm0); /* yè=z11 - z4 */ - movq_r2m (mm3, *(dataptr + 11)); /*save y5 */ + movq_r2m (mm3, *(dataptr + 11)); /*save y5 */ - movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ + movq_r2m (mm6, *(dataptr + 3)); /*save y1 */ - movq_r2m (mm0, *(dataptr + 15)); /*save y7 */ + movq_r2m (mm0, *(dataptr + 15)); /*save y7 */ #endif } -#define FIX_1_082392200 ((__s32) 277) /* FIX(1.082392200) */ -#define FIX_1_414213562 ((__s32) 362) /* FIX(1.414213562) */ -#define FIX_1_847759065 ((__s32) 473) /* FIX(1.847759065) */ -#define FIX_2_613125930 ((__s32) 669) /* FIX(2.613125930) */ +#define FIX_1_082392200 ((__s32) 277) /* FIX(1.082392200) */ +#define FIX_1_414213562 ((__s32) 362) /* FIX(1.414213562) */ +#define FIX_1_847759065 ((__s32) 473) /* FIX(1.847759065) */ +#define FIX_2_613125930 ((__s32) 669) /* FIX(2.613125930) */ #define DESCALE(x) (__s16)( ((x)+4) >> 3) @@ -1266,119 +1266,119 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* Odd part */ - movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ + movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ - movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ + movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ - movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ + movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ - movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ - */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ + movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ + */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ - paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ + paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ - psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ + psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ - psllw_i2r (2, mm2); /* shift z10 */ - movq_r2r (mm2, mm0); /* copy z10 */ + psllw_i2r (2, mm2); /* shift z10 */ + movq_r2r (mm2, mm0); /* copy z10 */ - pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ - movq_r2r (mm3, mm5); /* copy tmp4 */ + pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ + movq_r2r (mm3, mm5); /* copy tmp4 */ - pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ - paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ + pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ + paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ - movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ - psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ + movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ + psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ - psubw_r2r (mm1, mm6); /* z11-z13 */ - psllw_i2r (2, mm5); /* shift z12 */ + psubw_r2r (mm1, mm6); /* z11-z13 */ + psllw_i2r (2, mm5); /* shift z12 */ - movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ - movq_r2r (mm5, mm7); /* copy z12 */ + movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ + movq_r2r (mm5, mm7); /* copy z12 */ - pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6): even part */ - paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ + pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6): even part */ + paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ /*ok */ /* Even part */ - pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ + pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ psllw_i2r (2, mm6); - movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ + movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ - paddw_r2r (mm5, mm0); /* tmp10 */ + paddw_r2r (mm5, mm0); /* tmp10 */ - paddw_r2r (mm7, mm2); /* tmp12 */ + paddw_r2r (mm7, mm2); /* tmp12 */ - pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ - psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ + pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ + psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ - movq_r2r (mm1, mm5); /* copy tmp1 */ - paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ + movq_r2r (mm1, mm5); /* copy tmp1 */ + paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ - psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ - psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ + psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ + psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ - movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ - psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ + movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ + psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ - movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ + movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ - pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ - paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ + pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ + paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ - movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ + movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ - psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ + psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ - movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ - movq_r2r (mm7, mm1); /* copy tmp0 : phase 3 */ + movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ + movq_r2r (mm7, mm1); /* copy tmp0 : phase 3 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ - psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ + psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ - paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ - movq_r2r (mm1, mm5); /* copy tmp11 */ + paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ + movq_r2r (mm1, mm5); /* copy tmp11 */ - paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ - movq_r2r (mm7, mm4); /* copy tmp10 : phase 2 */ + paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ + movq_r2r (mm7, mm4); /* copy tmp10 : phase 2 */ - paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ + paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ - psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ - movq_r2r (mm7, mm0); /* copy tmp0 */ + psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ + movq_r2r (mm7, mm0); /* copy tmp0 */ - psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ - paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ + psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ + paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ - psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ + psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ - movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ - movq_r2r (mm1, mm3); /* copy tmp1 */ + movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ + movq_r2r (mm1, mm3); /* copy tmp1 */ - movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ - paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ + movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ + paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ - psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ + psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ - movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ - movq_r2r (mm4, mm1); /* copy tmp3 */ + movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ + movq_r2r (mm4, mm1); /* copy tmp3 */ - movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ + movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ - paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ + paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ - psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ + psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ movq_r2m (mm4, *(wsptr + 8)); - movq_r2r (mm5, mm7); /* copy tmp2 */ + movq_r2r (mm5, mm7); /* copy tmp2 */ - paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ + paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ movq_r2m (mm1, *(wsptr + 6)); - psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ + psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ movq_r2m (mm5, *(wsptr + 4)); @@ -1394,117 +1394,117 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /*****************************************************************/ - movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ + movq_m2r (*(idata + 10), mm1); /* load idata[DCTSIZE*5] */ - movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ + movq_m2r (*(idata + 6), mm0); /* load idata[DCTSIZE*3] */ - movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ - movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ - */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ - paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ + movq_m2r (*(idata + 2), mm3); /* load idata[DCTSIZE*1] */ + movq_r2r (mm1, mm2); /* copy tmp6 : phase 6 */ + */movq_m2r (*(idata + 14), mm4); /* load idata[DCTSIZE*7] */ + paddw_r2r (mm0, mm1); /* z13 = tmp6 + tmp5; */ - psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ + psubw_r2r (mm0, mm2); /* z10 = tmp6 - tmp5 */ - psllw_i2r (2, mm2); /* shift z10 */ - movq_r2r (mm2, mm0); /* copy z10 */ + psllw_i2r (2, mm2); /* shift z10 */ + movq_r2r (mm2, mm0); /* copy z10 */ - pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ - movq_r2r (mm3, mm5); /* copy tmp4 */ + pmulhw_m2r (fix_184n261, mm2); /* MULTIPLY( z12, FIX_1_847759065); : 2*c2 */ + movq_r2r (mm3, mm5); /* copy tmp4 */ - pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ - paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ + pmulhw_m2r (fix_n184, mm0); /* MULTIPLY(z10, -FIX_1_847759065); : 2*c2 */ + paddw_r2r (mm4, mm3); /* z11 = tmp4 + tmp7; */ - movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ - psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ + movq_r2r (mm3, mm6); /* copy z11 : phase 5 */ + psubw_r2r (mm4, mm5); /* z12 = tmp4 - tmp7; */ - psubw_r2r (mm1, mm6); /* z11-z13 */ - psllw_i2r (2, mm5); /* shift z12 */ + psubw_r2r (mm1, mm6); /* z11-z13 */ + psllw_i2r (2, mm5); /* shift z12 */ - movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ - movq_r2r (mm5, mm7); /* copy z12 */ + movq_m2r (*(idata + 12), mm4); /* load idata[DCTSIZE*6], even part */ + movq_r2r (mm5, mm7); /* copy z12 */ - pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6) even part */ - paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ + pmulhw_m2r (fix_108n184, mm5); /* MULT(z12, (FIX_1_08-FIX_1_84)) //- z5; 2*(c2-c6) even part */ + paddw_r2r (mm1, mm3); /* tmp7 = z11 + z13; */ /*ok */ /* Even part */ - pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ + pmulhw_m2r (fix_184, mm7); /* MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) //+ z5; -2*(c2+c6) */ psllw_i2r (2, mm6); - movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ + movq_m2r (*(idata + 4), mm1); /* load idata[DCTSIZE*2] */ - paddw_r2r (mm5, mm0); /* tmp10 */ + paddw_r2r (mm5, mm0); /* tmp10 */ - paddw_r2r (mm7, mm2); /* tmp12 */ + paddw_r2r (mm7, mm2); /* tmp12 */ - pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ - psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ + pmulhw_m2r (fix_141, mm6); /* tmp11 = MULTIPLY(z11 - z13, FIX_1_414213562); 2*c4 */ + psubw_r2r (mm3, mm2); /* tmp6 = tmp12 - tmp7 */ - movq_r2r (mm1, mm5); /* copy tmp1 */ - paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ + movq_r2r (mm1, mm5); /* copy tmp1 */ + paddw_r2r (mm4, mm1); /* tmp13= tmp1 + tmp3; phases 5-3 */ - psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ - psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ + psubw_r2r (mm4, mm5); /* tmp1-tmp3 */ + psubw_r2r (mm2, mm6); /* tmp5 = tmp11 - tmp6; */ - movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ - psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ + movq_r2m (mm1, *(wsptr)); /* save tmp13 in workspace */ + psllw_i2r (2, mm5); /* shift tmp1-tmp3 */ - movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ - paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ + movq_m2r (*(idata), mm7); /* load idata[DCTSIZE*0] */ + paddw_r2r (mm6, mm0); /* tmp4 = tmp10 + tmp5; */ - pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ + pmulhw_m2r (fix_141, mm5); /* MULTIPLY(tmp1 - tmp3, FIX_1_414213562) */ - movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ + movq_m2r (*(idata + 8), mm4); /* load idata[DCTSIZE*4] */ - psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ + psubw_r2r (mm1, mm5); /* tmp12 = MULTIPLY(tmp1 - tmp3, FIX_1_414213562) - tmp13; 2*c4 */ - movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ - movq_r2r (mm7, mm1); /* copy tmp0: phase 3 */ + movq_r2m (mm0, *(wsptr + 4)); /* save tmp4 in workspace */ + movq_r2r (mm7, mm1); /* copy tmp0: phase 3 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ - psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp12 in workspace */ + psubw_r2r (mm4, mm1); /* tmp11 = tmp0 - tmp2; */ - paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ - movq_r2r (mm1, mm5); /* copy tmp11 */ + paddw_r2r (mm4, mm7); /* tmp10 = tmp0 + tmp2; */ + movq_r2r (mm1, mm5); /* copy tmp11 */ - paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ - movq_r2r (mm7, mm4); /* copy tmp10: phase 2 */ + paddw_m2r (*(wsptr + 2), mm1); /* tmp1 = tmp11 + tmp12; */ + movq_r2r (mm7, mm4); /* copy tmp10: phase 2 */ - paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ + paddw_m2r (*(wsptr), mm7); /* tmp0 = tmp10 + tmp13; */ - psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ - movq_r2r (mm7, mm0); /* copy tmp0 */ + psubw_m2r (*(wsptr), mm4); /* tmp3 = tmp10 - tmp13; */ + movq_r2r (mm7, mm0); /* copy tmp0 */ - psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ - paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ + psubw_m2r (*(wsptr + 2), mm5); /* tmp2 = tmp11 - tmp12; */ + paddw_r2r (mm3, mm7); /* wsptr[DCTSIZE*0] = (int) (tmp0 + tmp7); */ - psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ + psubw_r2r (mm3, mm0); /* wsptr[DCTSIZE*7] = (int) (tmp0 - tmp7); */ - movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ - movq_r2r (mm1, mm3); /* copy tmp1 */ + movq_r2m (mm7, *(wsptr)); /* wsptr[DCTSIZE*0] */ + movq_r2r (mm1, mm3); /* copy tmp1 */ - movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ - paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ + movq_r2m (mm0, *(wsptr + 14)); /* wsptr[DCTSIZE*7] */ + paddw_r2r (mm2, mm1); /* wsptr[DCTSIZE*1] = (int) (tmp1 + tmp6); */ - psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ + psubw_r2r (mm2, mm3); /* wsptr[DCTSIZE*6] = (int) (tmp1 - tmp6); */ - movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ - movq_r2r (mm4, mm1); /* copy tmp3 */ + movq_r2m (mm1, *(wsptr + 2)); /* wsptr[DCTSIZE*1] */ + movq_r2r (mm4, mm1); /* copy tmp3 */ - movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ + movq_r2m (mm3, *(wsptr + 12)); /* wsptr[DCTSIZE*6] */ - paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ + paddw_m2r (*(wsptr + 4), mm4); /* wsptr[DCTSIZE*4] = (int) (tmp3 + tmp4); */ - psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ + psubw_m2r (*(wsptr + 4), mm1); /* wsptr[DCTSIZE*3] = (int) (tmp3 - tmp4); */ movq_r2m (mm4, *(wsptr + 8)); - movq_r2r (mm5, mm7); /* copy tmp2 */ + movq_r2r (mm5, mm7); /* copy tmp2 */ - paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ + paddw_r2r (mm6, mm5); /* wsptr[DCTSIZE*2] = (int) (tmp2 + tmp5) */ movq_r2m (mm1, *(wsptr + 6)); - psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ + psubw_r2r (mm6, mm7); /* wsptr[DCTSIZE*5] = (int) (tmp2 - tmp5); */ movq_r2m (mm5, *(wsptr + 4)); @@ -1525,62 +1525,62 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); */ /* tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); */ /* tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]); */ - movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ movq_r2r (mm0, mm2); - movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ + movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ - movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ - psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ + movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ movq_r2r (mm0, mm6); movq_r2r (mm3, mm5); - paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ + paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ movq_r2r (mm2, mm1); - psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ - punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ + psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ + punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ - movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ + movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ - movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ + movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ - punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ movq_r2r (mm3, mm4); - movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ - punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ + movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ - movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ + movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ - paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ + paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ movq_r2r (mm6, mm2); - psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ - paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ + psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ + paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ movq_r2r (mm3, mm5); - punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ + punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ - psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ - punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ + psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ + punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ movq_r2r (mm4, mm7); - punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ + punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ - punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ - punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ + punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ - punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ + punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ movq_r2r (mm1, mm6); /*ok */ @@ -1590,24 +1590,24 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) movq_r2r (mm0, mm2); - punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ + punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ - punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ + punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ psllw_i2r (2, mm6); pmulhw_m2r (fix_141, mm6); - punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ + punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ - punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ + punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ movq_r2r (mm0, mm7); /* tmp0 = tmp10 + tmp13; */ /* tmp3 = tmp10 - tmp13; */ - paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ - psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ + paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ + psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ /* tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13; */ - psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ + psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ /* tmp1 = tmp11 + tmp12; */ /* tmp2 = tmp11 - tmp12; */ movq_r2r (mm1, mm5); @@ -1620,115 +1620,115 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; */ /* z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; */ /* z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; */ - movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ + movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ - movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ - psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ + movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ movq_r2r (mm3, mm6); - punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ + punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ - punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ + punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ movq_r2r (mm3, mm2); /*Save tmp0 and tmp1 in wsptr */ - movq_r2m (mm0, *(wsptr)); /* save tmp0 */ - paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ + movq_r2m (mm0, *(wsptr)); /* save tmp0 */ + paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ /*Continue with z10 --- z13 */ - movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ + movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ - movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ movq_r2r (mm6, mm4); - movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ - punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ + movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ + punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ - punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ + punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ movq_r2r (mm6, mm1); /*Save tmp2 and tmp3 in wsptr */ - paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ + paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ movq_r2r (mm2, mm4); /*Continue with z10 --- z13 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ - punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ + punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ - psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ - punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ + psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ + punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ movq_r2r (mm3, mm0); - punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ + punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ - movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ - punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ + movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ + punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ - movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ + movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ - movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ + movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ - movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm6, mm4); - punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ + punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ movq_r2r (mm1, mm5); - punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ + punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ movq_r2r (mm6, mm2); - movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ + movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ - psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ - punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ + psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ + punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ - punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ + punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ movq_r2r (mm1, mm7); - paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ - psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ + paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ + psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ movq_r2r (mm6, mm5); - punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ + punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ - punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ + punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ movq_r2r (mm2, mm4); - punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ + punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ - punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ + punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ - punpckhdq_r2r (mm6, mm4); /*/ wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ + punpckhdq_r2r (mm6, mm4); /*/ wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ - punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ + punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ movq_r2r (mm0, mm5); - punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ + punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ - punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ + punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ movq_r2r (mm3, mm4); - punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ + punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ movq_r2r (mm5, mm1); - punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ + punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ /* tmp7 = z11 + z13; : phase 5 */ /* tmp8 = z11 - z13; : phase 5 */ - psubw_r2r (mm4, mm1); /* tmp8 */ + psubw_r2r (mm4, mm1); /* tmp8 */ - paddw_r2r (mm4, mm5); /* tmp7 */ + paddw_r2r (mm4, mm5); /* tmp7 */ /* tmp21 = MULTIPLY(tmp8, FIX_1_414213562); 2*c4 */ psllw_i2r (2, mm1); psllw_i2r (2, mm0); - pmulhw_m2r (fix_141, mm1); /* tmp21 */ + pmulhw_m2r (fix_141, mm1); /* tmp21 */ /* tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) 2*(c2-c6) */ /* + MULTIPLY(z10, - FIX_1_847759065); : 2*c2 */ psllw_i2r (2, mm3); @@ -1737,36 +1737,36 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) pmulhw_m2r (fix_n184, mm7); movq_r2r (mm3, mm6); - movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ + movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ pmulhw_m2r (fix_108n184, mm6); /* tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) : -2*(c2+c6) */ /* + MULTIPLY(z12, FIX_1_847759065); 2*c2 */ - movq_r2r (mm2, mm4); /* final1 */ + movq_r2r (mm2, mm4); /* final1 */ pmulhw_m2r (fix_184n261, mm0); - paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ + paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ pmulhw_m2r (fix_184, mm3); - psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ + psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ /* tmp6 = tmp22 - tmp7; phase 2 */ - psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ + psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ - paddw_r2r (mm6, mm7); /* tmp20 */ - psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ + paddw_r2r (mm6, mm7); /* tmp20 */ + psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ - paddw_r2r (mm0, mm3); /* tmp22 */ + paddw_r2r (mm0, mm3); /* tmp22 */ /* tmp5 = tmp21 - tmp6; */ - psubw_r2r (mm5, mm3); /* tmp6 */ + psubw_r2r (mm5, mm3); /* tmp6 */ /* tmp4 = tmp20 + tmp5; */ - movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ - psubw_r2r (mm3, mm1); /* tmp5 */ + movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ + psubw_r2r (mm3, mm1); /* tmp5 */ - movq_r2r (mm0, mm6); /* final2 */ - paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ + movq_r2r (mm0, mm6); /* final2 */ + paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ /* Final output stage: scale down by a factor of 8 and range-limit */ @@ -1781,30 +1781,30 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* & RANGE_MASK]; */ /* outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) */ /* & RANGE_MASK]; final2 */ - psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ - psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ + psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ + psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ - psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ + psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ - packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ + packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ - movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ - packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ + movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ + packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ /* outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; */ /* outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; final3 */ - paddw_r2r (mm1, mm7); /* tmp4 */ + paddw_r2r (mm1, mm7); /* tmp4 */ movq_r2r (mm5, mm3); - paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ - psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ + paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ + psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ - psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ + psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ - movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ - psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ + movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ + psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ @@ -1813,45 +1813,45 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) */ /* & RANGE_MASK]; final4 */ movq_r2r (mm4, mm6); - paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ + paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ - psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ - psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ + psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ + psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ /* mov ecx, [dataptr] */ - psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ + psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ - packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ + packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ - packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ + packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ movq_r2r (mm2, mm4); movq_r2r (mm5, mm7); - punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ + punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ - punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ + punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ movq_r2r (mm2, mm1); - punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ + punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ /* add dataptr, 4 */ - punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ + punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ - punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ + punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ /* add ecx, output_col */ movq_r2r (mm7, mm6); - punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm2, mm0); - punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ + punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ /* mov idata, [dataptr] */ - punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ + punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ /* add dataptr, 4 */ @@ -1859,17 +1859,17 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* add idata, output_col */ - punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ movq_r2m (mm2, *(dataptr)); - punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ + punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ dataptr += rskip; movq_r2m (mm0, *(dataptr)); - punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ + punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ + punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ dataptr += rskip; movq_r2m (mm1, *(dataptr)); @@ -1887,61 +1887,61 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* tmp13 = ((DCTELEM) wsptr[2] + (DCTELEM) wsptr[6]); */ /* tmp11 = ((DCTELEM) wsptr[0] - (DCTELEM) wsptr[4]); */ /* tmp14 = ((DCTELEM) wsptr[2] - (DCTELEM) wsptr[6]); */ - movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + movq_m2r (*(wsptr), mm0); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + movq_m2r (*(wsptr + 1), mm1); /* wsptr[0,4],[0,5],[0,6],[0,7] */ movq_r2r (mm0, mm2); - movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ + movq_m2r (*(wsptr + 2), mm3); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + paddw_r2r (mm1, mm0); /* wsptr[0,tmp10],[xxx],[0,tmp13],[xxx] */ - movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ - psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ + movq_m2r (*(wsptr + 3), mm4); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + psubw_r2r (mm1, mm2); /* wsptr[0,tmp11],[xxx],[0,tmp14],[xxx] */ movq_r2r (mm0, mm6); movq_r2r (mm3, mm5); - paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ + paddw_r2r (mm4, mm3); /* wsptr[1,tmp10],[xxx],[1,tmp13],[xxx] */ movq_r2r (mm2, mm1); - psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ - punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ + psubw_r2r (mm4, mm5); /* wsptr[1,tmp11],[xxx],[1,tmp14],[xxx] */ + punpcklwd_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[xxx],[xxx] */ - movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ + movq_m2r (*(wsptr + 7), mm7); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm3, mm6); /* wsptr[0,tmp13],[1,tmp13],[xxx],[xxx] */ - movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ + movq_m2r (*(wsptr + 4), mm3); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckldq_r2r (mm6, mm0); /* wsptr[0,tmp10],[1,tmp10],[0,tmp13],[1,tmp13] */ - punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm5, mm1); /* wsptr[0,tmp11],[1,tmp11],[xxx],[xxx] */ movq_r2r (mm3, mm4); - movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ - punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ + movq_m2r (*(wsptr + 6), mm6); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm2); /* wsptr[0,tmp14],[1,tmp14],[xxx],[xxx] */ - movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ + movq_m2r (*(wsptr + 5), mm5); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckldq_r2r (mm2, mm1); /* wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ - paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ + paddw_r2r (mm5, mm3); /* wsptr[2,tmp10],[xxx],[2,tmp13],[xxx] */ movq_r2r (mm6, mm2); - psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ - paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ + psubw_r2r (mm5, mm4); /* wsptr[2,tmp11],[xxx],[2,tmp14],[xxx] */ + paddw_r2r (mm7, mm6); /* wsptr[3,tmp10],[xxx],[3,tmp13],[xxx] */ movq_r2r (mm3, mm5); - punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ + punpcklwd_r2r (mm6, mm3); /* wsptr[2,tmp10],[3,tmp10],[xxx],[xxx] */ - psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ - punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ + psubw_r2r (mm7, mm2); /* wsptr[3,tmp11],[xxx],[3,tmp14],[xxx] */ + punpckhwd_r2r (mm6, mm5); /* wsptr[2,tmp13],[3,tmp13],[xxx],[xxx] */ movq_r2r (mm4, mm7); - punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ + punpckldq_r2r (mm5, mm3); /* wsptr[2,tmp10],[3,tmp10],[2,tmp13],[3,tmp13] */ - punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ + punpcklwd_r2r (mm2, mm4); /* wsptr[2,tmp11],[3,tmp11],[xxx],[xxx] */ - punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ + punpckhwd_r2r (mm2, mm7); /* wsptr[2,tmp14],[3,tmp14],[xxx],[xxx] */ - punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ + punpckldq_r2r (mm7, mm4); /* wsptr[2,tmp11],[3,tmp11],[2,tmp14],[3,tmp14] */ movq_r2r (mm1, mm6); /*OK */ @@ -1950,24 +1950,24 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* mm1 = ;wsptr[0,tmp11],[1,tmp11],[0,tmp14],[1,tmp14] */ movq_r2r (mm0, mm2); - punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ + punpckhdq_r2r (mm4, mm6); /* wsptr[0,tmp14],[1,tmp14],[2,tmp14],[3,tmp14] */ - punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ + punpckldq_r2r (mm4, mm1); /* wsptr[0,tmp11],[1,tmp11],[2,tmp11],[3,tmp11] */ psllw_i2r (2, mm6); pmulhw_m2r (fix_141, mm6); - punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ + punpckldq_r2r (mm3, mm0); /* wsptr[0,tmp10],[1,tmp10],[2,tmp10],[3,tmp10] */ - punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ + punpckhdq_r2r (mm3, mm2); /* wsptr[0,tmp13],[1,tmp13],[2,tmp13],[3,tmp13] */ movq_r2r (mm0, mm7); /* tmp0 = tmp10 + tmp13; */ /* tmp3 = tmp10 - tmp13; */ - paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ - psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ + paddw_r2r (mm2, mm0); /* [0,tmp0],[1,tmp0],[2,tmp0],[3,tmp0] */ + psubw_r2r (mm2, mm7); /* [0,tmp3],[1,tmp3],[2,tmp3],[3,tmp3] */ /* tmp12 = MULTIPLY(tmp14, FIX_1_414213562) - tmp13; */ - psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ + psubw_r2r (mm2, mm6); /* wsptr[0,tmp12],[1,tmp12],[2,tmp12],[3,tmp12] */ /* tmp1 = tmp11 + tmp12; */ /* tmp2 = tmp11 - tmp12; */ movq_r2r (mm1, mm5); @@ -1981,115 +1981,115 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* z10 = (DCTELEM) wsptr[5] - (DCTELEM) wsptr[3]; */ /* z11 = (DCTELEM) wsptr[1] + (DCTELEM) wsptr[7]; */ /* z12 = (DCTELEM) wsptr[1] - (DCTELEM) wsptr[7]; */ - movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ - paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ + movq_m2r (*(wsptr), mm3); /* wsptr[0,0],[0,1],[0,2],[0,3] */ + paddw_r2r (mm6, mm1); /* [0,tmp1],[1,tmp1],[2,tmp1],[3,tmp1] */ - movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ - psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ + movq_m2r (*(wsptr + 1), mm4); /* wsptr[0,4],[0,5],[0,6],[0,7] */ + psubw_r2r (mm6, mm5); /* [0,tmp2],[1,tmp2],[2,tmp2],[3,tmp2] */ movq_r2r (mm3, mm6); - punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ + punpckldq_r2r (mm4, mm3); /* wsptr[0,0],[0,1],[0,4],[0,5] */ - punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ + punpckhdq_r2r (mm6, mm4); /* wsptr[0,6],[0,7],[0,2],[0,3] */ movq_r2r (mm3, mm2); /*Save tmp0 and tmp1 in wsptr */ - movq_r2m (mm0, *(wsptr)); /* save tmp0 */ - paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ + movq_r2m (mm0, *(wsptr)); /* save tmp0 */ + paddw_r2r (mm4, mm2); /* wsptr[xxx],[0,z11],[xxx],[0,z13] */ /*Continue with z10 --- z13 */ - movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ - psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ + movq_m2r (*(wsptr + 2), mm6); /* wsptr[1,0],[1,1],[1,2],[1,3] */ + psubw_r2r (mm4, mm3); /* wsptr[xxx],[0,z12],[xxx],[0,z10] */ - movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ + movq_m2r (*(wsptr + 3), mm0); /* wsptr[1,4],[1,5],[1,6],[1,7] */ movq_r2r (mm6, mm4); - movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ - punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ + movq_r2m (mm1, *(wsptr + 1)); /* save tmp1 */ + punpckldq_r2r (mm0, mm6); /* wsptr[1,0],[1,1],[1,4],[1,5] */ - punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ + punpckhdq_r2r (mm4, mm0); /* wsptr[1,6],[1,7],[1,2],[1,3] */ movq_r2r (mm6, mm1); /*Save tmp2 and tmp3 in wsptr */ - paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ + paddw_r2r (mm0, mm6); /* wsptr[xxx],[1,z11],[xxx],[1,z13] */ movq_r2r (mm2, mm4); /*Continue with z10 --- z13 */ - movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ - punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ + movq_r2m (mm5, *(wsptr + 2)); /* save tmp2 */ + punpcklwd_r2r (mm6, mm2); /* wsptr[xxx],[xxx],[0,z11],[1,z11] */ - psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ - punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ + psubw_r2r (mm0, mm1); /* wsptr[xxx],[1,z12],[xxx],[1,z10] */ + punpckhwd_r2r (mm6, mm4); /* wsptr[xxx],[xxx],[0,z13],[1,z13] */ movq_r2r (mm3, mm0); - punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ + punpcklwd_r2r (mm1, mm3); /* wsptr[xxx],[xxx],[0,z12],[1,z12] */ - movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ - punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ + movq_r2m (mm7, *(wsptr + 3)); /* save tmp3 */ + punpckhwd_r2r (mm1, mm0); /* wsptr[xxx],[xxx],[0,z10],[1,z10] */ - movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ - punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ + movq_m2r (*(wsptr + 4), mm6); /* wsptr[2,0],[2,1],[2,2],[2,3] */ + punpckhdq_r2r (mm2, mm0); /* wsptr[0,z10],[1,z10],[0,z11],[1,z11] */ - movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ + movq_m2r (*(wsptr + 5), mm7); /* wsptr[2,4],[2,5],[2,6],[2,7] */ + punpckhdq_r2r (mm4, mm3); /* wsptr[0,z12],[1,z12],[0,z13],[1,z13] */ - movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ + movq_m2r (*(wsptr + 6), mm1); /* wsptr[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm6, mm4); - punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ + punpckldq_r2r (mm7, mm6); /* wsptr[2,0],[2,1],[2,4],[2,5] */ movq_r2r (mm1, mm5); - punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ + punpckhdq_r2r (mm4, mm7); /* wsptr[2,6],[2,7],[2,2],[2,3] */ movq_r2r (mm6, mm2); - movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ - paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ + movq_m2r (*(wsptr + 7), mm4); /* wsptr[3,4],[3,5],[3,6],[3,7] */ + paddw_r2r (mm7, mm6); /* wsptr[xxx],[2,z11],[xxx],[2,z13] */ - psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ - punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ + psubw_r2r (mm7, mm2); /* wsptr[xxx],[2,z12],[xxx],[2,z10] */ + punpckldq_r2r (mm4, mm1); /* wsptr[3,0],[3,1],[3,4],[3,5] */ - punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ + punpckhdq_r2r (mm5, mm4); /* wsptr[3,6],[3,7],[3,2],[3,3] */ movq_r2r (mm1, mm7); - paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ - psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ + paddw_r2r (mm4, mm1); /* wsptr[xxx],[3,z11],[xxx],[3,z13] */ + psubw_r2r (mm4, mm7); /* wsptr[xxx],[3,z12],[xxx],[3,z10] */ movq_r2r (mm6, mm5); - punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ + punpcklwd_r2r (mm1, mm6); /* wsptr[xxx],[xxx],[2,z11],[3,z11] */ - punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ + punpckhwd_r2r (mm1, mm5); /* wsptr[xxx],[xxx],[2,z13],[3,z13] */ movq_r2r (mm2, mm4); - punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ + punpcklwd_r2r (mm7, mm2); /* wsptr[xxx],[xxx],[2,z12],[3,z12] */ - punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ + punpckhwd_r2r (mm7, mm4); /* wsptr[xxx],[xxx],[2,z10],[3,z10] */ - punpckhdq_r2r (mm6, mm4); /* wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ + punpckhdq_r2r (mm6, mm4); /* wsptr[2,z10],[3,z10],[2,z11],[3,z11] */ - punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ + punpckhdq_r2r (mm5, mm2); /* wsptr[2,z12],[3,z12],[2,z13],[3,z13] */ movq_r2r (mm0, mm5); - punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ + punpckldq_r2r (mm4, mm0); /* wsptr[0,z10],[1,z10],[2,z10],[3,z10] */ - punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ + punpckhdq_r2r (mm4, mm5); /* wsptr[0,z11],[1,z11],[2,z11],[3,z11] */ movq_r2r (mm3, mm4); - punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ + punpckhdq_r2r (mm2, mm4); /* wsptr[0,z13],[1,z13],[2,z13],[3,z13] */ movq_r2r (mm5, mm1); - punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ + punpckldq_r2r (mm2, mm3); /* wsptr[0,z12],[1,z12],[2,z12],[3,z12] */ /* tmp7 = z11 + z13; : phase 5 */ /* tmp8 = z11 - z13; : phase 5 */ - psubw_r2r (mm4, mm1); /* tmp8 */ + psubw_r2r (mm4, mm1); /* tmp8 */ - paddw_r2r (mm4, mm5); /* tmp7 */ + paddw_r2r (mm4, mm5); /* tmp7 */ /* tmp21 = MULTIPLY(tmp8, FIX_1_414213562); 2*c4 */ psllw_i2r (2, mm1); psllw_i2r (2, mm0); - pmulhw_m2r (fix_141, mm1); /* tmp21 */ + pmulhw_m2r (fix_141, mm1); /* tmp21 */ /* tmp20 = MULTIPLY(z12, (FIX_1_082392200- FIX_1_847759065)) : 2*(c2-c6) */ /* + MULTIPLY(z10, - FIX_1_847759065); : 2*c2 */ psllw_i2r (2, mm3); @@ -2098,36 +2098,36 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) pmulhw_m2r (fix_n184, mm7); movq_r2r (mm3, mm6); - movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ + movq_m2r (*(wsptr), mm2); /* tmp0,final1 */ pmulhw_m2r (fix_108n184, mm6); /* tmp22 = MULTIPLY(z10,(FIX_1_847759065 - FIX_2_613125930)) : -2*(c2+c6) */ /* + MULTIPLY(z12, FIX_1_847759065); : 2*c2 */ - movq_r2r (mm2, mm4); /* final1 */ + movq_r2r (mm2, mm4); /* final1 */ pmulhw_m2r (fix_184n261, mm0); - paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ + paddw_r2r (mm5, mm2); /* tmp0+tmp7,final1 */ pmulhw_m2r (fix_184, mm3); - psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ + psubw_r2r (mm5, mm4); /* tmp0-tmp7,final1 */ /* tmp6 = tmp22 - tmp7; phase 2 */ - psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ + psraw_i2r (3, mm2); /* outptr[0,0],[1,0],[2,0],[3,0],final1 */ - paddw_r2r (mm6, mm7); /* tmp20 */ - psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ + paddw_r2r (mm6, mm7); /* tmp20 */ + psraw_i2r (3, mm4); /* outptr[0,7],[1,7],[2,7],[3,7],final1 */ - paddw_r2r (mm0, mm3); /* tmp22 */ + paddw_r2r (mm0, mm3); /* tmp22 */ /* tmp5 = tmp21 - tmp6; */ - psubw_r2r (mm5, mm3); /* tmp6 */ + psubw_r2r (mm5, mm3); /* tmp6 */ /* tmp4 = tmp20 + tmp5; */ - movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ - psubw_r2r (mm3, mm1); /* tmp5 */ + movq_m2r (*(wsptr + 1), mm0); /* tmp1,final2 */ + psubw_r2r (mm3, mm1); /* tmp5 */ - movq_r2r (mm0, mm6); /* final2 */ - paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ + movq_r2r (mm0, mm6); /* final2 */ + paddw_r2r (mm3, mm0); /* tmp1+tmp6,final2 */ /* Final output stage: scale down by a factor of 8 and range-limit */ @@ -2141,30 +2141,30 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* & RANGE_MASK]; */ /* outptr[6] = range_limit[IDESCALE(tmp1 - tmp6, PASS1_BITS+3) */ /* & RANGE_MASK]; final2 */ - psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ - psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ + psubw_r2r (mm3, mm6); /* tmp1-tmp6,final2 */ + psraw_i2r (3, mm0); /* outptr[0,1],[1,1],[2,1],[3,1] */ - psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ + psraw_i2r (3, mm6); /* outptr[0,6],[1,6],[2,6],[3,6] */ - packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ + packuswb_r2r (mm4, mm0); /* out[0,1],[1,1],[2,1],[3,1],[0,7],[1,7],[2,7],[3,7] */ - movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ - packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ + movq_m2r (*(wsptr + 2), mm5); /* tmp2,final3 */ + packuswb_r2r (mm6, mm2); /* out[0,0],[1,0],[2,0],[3,0],[0,6],[1,6],[2,6],[3,6] */ /* outptr[2] = range_limit[IDESCALE(tmp2 + tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; */ /* outptr[5] = range_limit[IDESCALE(tmp2 - tmp5, PASS1_BITS+3) */ /* & RANGE_MASK]; final3 */ - paddw_r2r (mm1, mm7); /* tmp4 */ + paddw_r2r (mm1, mm7); /* tmp4 */ movq_r2r (mm5, mm3); - paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ - psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ + paddw_r2r (mm1, mm5); /* tmp2+tmp5 */ + psubw_r2r (mm1, mm3); /* tmp2-tmp5 */ - psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ + psraw_i2r (3, mm5); /* outptr[0,2],[1,2],[2,2],[3,2] */ - movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ - psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ + movq_m2r (*(wsptr + 3), mm4); /* tmp3,final4 */ + psraw_i2r (3, mm3); /* outptr[0,5],[1,5],[2,5],[3,5] */ @@ -2173,12 +2173,12 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) /* outptr[3] = range_limit[IDESCALE(tmp3 - tmp4, PASS1_BITS+3) */ /* & RANGE_MASK]; final4 */ movq_r2r (mm4, mm6); - paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ + paddw_r2r (mm7, mm4); /* tmp3+tmp4 */ - psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ - psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ + psubw_r2r (mm7, mm6); /* tmp3-tmp4 */ + psraw_i2r (3, mm4); /* outptr[0,4],[1,4],[2,4],[3,4] */ - psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ + psraw_i2r (3, mm6); /* outptr[0,3],[1,3],[2,3],[3,3] */ /* movq_r2m(mm4, *dummy); @@ -2188,46 +2188,46 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) */ - packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ + packuswb_r2r (mm4, mm5); /* out[0,2],[1,2],[2,2],[3,2],[0,4],[1,4],[2,4],[3,4] */ - packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ + packuswb_r2r (mm3, mm6); /* out[0,3],[1,3],[2,3],[3,3],[0,5],[1,5],[2,5],[3,5] */ movq_r2r (mm2, mm4); movq_r2r (mm5, mm7); - punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ + punpcklbw_r2r (mm0, mm2); /* out[0,0],[0,1],[1,0],[1,1],[2,0],[2,1],[3,0],[3,1] */ - punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ + punpckhbw_r2r (mm0, mm4); /* out[0,6],[0,7],[1,6],[1,7],[2,6],[2,7],[3,6],[3,7] */ movq_r2r (mm2, mm1); - punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ + punpcklbw_r2r (mm6, mm5); /* out[0,2],[0,3],[1,2],[1,3],[2,2],[2,3],[3,2],[3,3] */ - punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ + punpckhbw_r2r (mm6, mm7); /* out[0,4],[0,5],[1,4],[1,5],[2,4],[2,5],[3,4],[3,5] */ - punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ + punpcklwd_r2r (mm5, mm2); /* out[0,0],[0,1],[0,2],[0,3],[1,0],[1,1],[1,2],[1,3] */ movq_r2r (mm7, mm6); - punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ + punpckhwd_r2r (mm5, mm1); /* out[2,0],[2,1],[2,2],[2,3],[3,0],[3,1],[3,2],[3,3] */ movq_r2r (mm2, mm0); - punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ + punpcklwd_r2r (mm4, mm6); /* out[0,4],[0,5],[0,6],[0,7],[1,4],[1,5],[1,6],[1,7] */ - punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ + punpckldq_r2r (mm6, mm2); /* out[0,0],[0,1],[0,2],[0,3],[0,4],[0,5],[0,6],[0,7] */ movq_r2r (mm1, mm3); - punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ + punpckhwd_r2r (mm4, mm7); /* out[2,4],[2,5],[2,6],[2,7],[3,4],[3,5],[3,6],[3,7] */ dataptr += rskip; movq_r2m (mm2, *(dataptr)); - punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ + punpckhdq_r2r (mm6, mm0); /* out[1,0],[1,1],[1,2],[1,3],[1,4],[1,5],[1,6],[1,7] */ dataptr += rskip; movq_r2m (mm0, *(dataptr)); - punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ + punpckldq_r2r (mm7, mm1); /* out[2,0],[2,1],[2,2],[2,3],[2,4],[2,5],[2,6],[2,7] */ - punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ + punpckhdq_r2r (mm7, mm3); /* out[3,0],[3,1],[3,2],[3,3],[3,4],[3,5],[3,6],[3,7] */ dataptr += rskip; movq_r2m (mm1, *(dataptr)); @@ -2251,7 +2251,7 @@ RTjpeg_idct (__u8 * odata, __s16 * data, int rskip) for (ctr = 8; ctr > 0; ctr--) { if ((inptr[8] | inptr[16] | inptr[24] | - inptr[32] | inptr[40] | inptr[48] | inptr[56]) == 0) { + inptr[32] | inptr[40] | inptr[48] | inptr[56]) == 0) { dcval = inptr[0]; wsptr[0] = dcval; wsptr[8] = dcval; @@ -2388,7 +2388,7 @@ RTjpeg_init_data (void) dptr = (unsigned long) &(RTjpeg_alldata[0]); dptr += 32; dptr = dptr >> 5; - dptr = dptr << 5; /* cache align data */ + dptr = dptr << 5; /* cache align data */ RTjpeg_block = (__s16 *) dptr; dptr += sizeof (__s16) * 64; @@ -2418,15 +2418,15 @@ RTjpeg_init_Q (__u8 Q) int i; __u64 qual; - qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ + qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ for (i = 0; i < 64; i++) { RTjpeg_lqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); if (RTjpeg_lqt[i] == 0) RTjpeg_lqt[i] = 1; RTjpeg_cqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); if (RTjpeg_cqt[i] == 0) RTjpeg_cqt[i] = 1; RTjpeg_liqt[i] = (1 << 16) / (RTjpeg_lqt[i] << 3); @@ -2476,15 +2476,15 @@ RTjpeg_init_compress (__u32 * buf, int width, int height, __u8 Q) RTjpeg_Cwidth = RTjpeg_width >> 4; RTjpeg_Csize = (width >> 1) * height; - qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ + qual = (__u64) Q << (32 - 7); /* 32 bit FP, 255=2, 0=0 */ for (i = 0; i < 64; i++) { RTjpeg_lqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_lum_quant_tbl[i] << 16)) >> 3); if (RTjpeg_lqt[i] == 0) RTjpeg_lqt[i] = 1; RTjpeg_cqt[i] = - (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); + (__s32) ((qual / ((__u64) RTjpeg_chrom_quant_tbl[i] << 16)) >> 3); if (RTjpeg_cqt[i] == 0) RTjpeg_cqt[i] = 1; RTjpeg_liqt[i] = (1 << 16) / (RTjpeg_lqt[i] << 3); @@ -2678,28 +2678,28 @@ RTjpeg_decompressYUV422 (__s8 * sp, __u8 * bp) for (i = RTjpeg_height; i; i -= 8) { for (k = 0, j = 0; j < RTjpeg_width; j += 16, k += 8) { if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); } } bp += RTjpeg_width << 3; @@ -2727,40 +2727,40 @@ RTjpeg_decompressYUV420 (__s8 * sp, __u8 * bp) for (i = RTjpeg_height >> 1; i; i -= 8) { for (k = 0, j = 0; j < RTjpeg_width; j += 16, k += 8) { if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j + 8, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp1 + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp1 + j, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp1 + j + 8, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp1 + j + 8, RTjpeg_block, RTjpeg_width); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp2 + k, RTjpeg_block, RTjpeg_width >> 1); } if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); - RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_cb8, RTjpeg_ciqt); + RTjpeg_idct (bp3 + k, RTjpeg_block, RTjpeg_width >> 1); } } bp += RTjpeg_width << 4; @@ -2786,10 +2786,10 @@ RTjpeg_decompress8 (__s8 * sp, __u8 * bp) for (i = 0; i < RTjpeg_height; i += 8) { for (j = 0; j < RTjpeg_width; j += 8) if (*sp == -1) - sp++; + sp++; else { - sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); - RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); + sp += RTjpeg_s2b (RTjpeg_block, sp, RTjpeg_lb8, RTjpeg_liqt); + RTjpeg_idct (bp + j, RTjpeg_block, RTjpeg_width); } bp += RTjpeg_width << 3; } @@ -2861,7 +2861,7 @@ RTjpeg_bcomp (__s16 * old, mmx_t * mask) if (result.q) { if (!RTjpeg_mtest) for (i = 0; i < 16; i++) - ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; + ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; return 0; } /* printf("."); */ @@ -2877,8 +2877,8 @@ RTjpeg_bcomp (__s16 * old, __u16 * mask) for (i = 0; i < 64; i++) if (abs (old[i] - RTjpeg_block[i]) > *mask) { if (!RTjpeg_mtest) - for (i = 0; i < 16; i++) - ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; + for (i = 0; i < 16; i++) + ((__u64 *) old)[i] = ((__u64 *) RTjpeg_block)[i]; return 0; } return 1; @@ -2904,10 +2904,10 @@ RTjpeg_mcompress (__s8 * sp, unsigned char *bp, __u16 lmask, __u16 cmask) emms (); RTjpeg_lmask = (mmx_t) (((__u64) lmask << 48) | ((__u64) lmask << 32) | ((__u64) lmask << - 16) | lmask); + 16) | lmask); RTjpeg_cmask = (mmx_t) (((__u64) cmask << 48) | ((__u64) cmask << 32) | ((__u64) cmask << - 16) | cmask); + 16) | cmask); #else RTjpeg_lmask = lmask; RTjpeg_cmask = cmask; @@ -2925,33 +2925,33 @@ RTjpeg_mcompress (__s8 * sp, unsigned char *bp, __u16 lmask, __u16 cmask) RTjpeg_dctY (bp + j, RTjpeg_block, RTjpeg_Ywidth); RTjpeg_quant (RTjpeg_block, RTjpeg_lqt); if (RTjpeg_bcomp (block, &RTjpeg_lmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); block += 64; RTjpeg_dctY (bp + j + 8, RTjpeg_block, RTjpeg_Ywidth); RTjpeg_quant (RTjpeg_block, RTjpeg_lqt); if (RTjpeg_bcomp (block, &RTjpeg_lmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); block += 64; RTjpeg_dctY (bp2 + k, RTjpeg_block, RTjpeg_Cwidth); RTjpeg_quant (RTjpeg_block, RTjpeg_cqt); if (RTjpeg_bcomp (block, &RTjpeg_cmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); block += 64; RTjpeg_dctY (bp3 + k, RTjpeg_block, RTjpeg_Cwidth); RTjpeg_quant (RTjpeg_block, RTjpeg_cqt); if (RTjpeg_bcomp (block, &RTjpeg_cmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_cb8); block += 64; } @@ -2977,7 +2977,7 @@ RTjpeg_mcompress8 (__s8 * sp, unsigned char *bp, __u16 lmask) emms (); RTjpeg_lmask = (mmx_t) (((__u64) lmask << 48) | ((__u64) lmask << 32) | ((__u64) lmask << - 16) | lmask); + 16) | lmask); #else RTjpeg_lmask = lmask; #endif @@ -2991,10 +2991,10 @@ RTjpeg_mcompress8 (__s8 * sp, unsigned char *bp, __u16 lmask) RTjpeg_dctY (bp + j, RTjpeg_block, RTjpeg_width); RTjpeg_quant (RTjpeg_block, RTjpeg_lqt); if (RTjpeg_bcomp (block, &RTjpeg_lmask)) { - *((__u8 *) sp++) = 255; + *((__u8 *) sp++) = 255; /* printf("* %d ", sp[-1]); */ } else - sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); + sp += RTjpeg_b2s (RTjpeg_block, sp, RTjpeg_lb8); block += 64; } bp += RTjpeg_width << 3; diff --git a/gst/rtjpeg/gstrtjpeg.c b/gst/rtjpeg/gstrtjpeg.c index e61cb7d0..2a90e30a 100644 --- a/gst/rtjpeg/gstrtjpeg.c +++ b/gst/rtjpeg/gstrtjpeg.c @@ -28,9 +28,9 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "rtjpegenc", - GST_RANK_NONE, GST_TYPE_RTJPEGENC) || + GST_RANK_NONE, GST_TYPE_RTJPEGENC) || !gst_element_register (plugin, "rtjpegdec", - GST_RANK_NONE, GST_TYPE_RTJPEGDEC)) + GST_RANK_NONE, GST_TYPE_RTJPEGDEC)) return FALSE; return TRUE; diff --git a/gst/rtjpeg/gstrtjpegdec.c b/gst/rtjpeg/gstrtjpegdec.c index 44dcc3f3..e96d4a09 100644 --- a/gst/rtjpeg/gstrtjpegdec.c +++ b/gst/rtjpeg/gstrtjpegdec.c @@ -74,9 +74,10 @@ gst_rtjpegdec_get_type (void) 0, (GInstanceInitFunc) gst_rtjpegdec_init, }; + rtjpegdec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegDec", - &rtjpegdec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegDec", + &rtjpegdec_info, 0); } return rtjpegdec_type; } diff --git a/gst/rtjpeg/gstrtjpegenc.c b/gst/rtjpeg/gstrtjpegenc.c index 14d7df1f..dbb364ac 100644 --- a/gst/rtjpeg/gstrtjpegenc.c +++ b/gst/rtjpeg/gstrtjpegenc.c @@ -72,9 +72,10 @@ gst_rtjpegenc_get_type (void) 0, (GInstanceInitFunc) gst_rtjpegenc_init, }; + rtjpegenc_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegEnc", - &rtjpegenc_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstRTJpegEnc", + &rtjpegenc_info, 0); } return rtjpegenc_type; } diff --git a/gst/smooth/gstsmooth.c b/gst/smooth/gstsmooth.c index 0302c7e0..fd2d576a 100644 --- a/gst/smooth/gstsmooth.c +++ b/gst/smooth/gstsmooth.c @@ -99,8 +99,9 @@ gst_smooth_get_type (void) 0, (GInstanceInitFunc) gst_smooth_init, }; + smooth_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSmooth", &smooth_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSmooth", &smooth_info, 0); } return smooth_type; } @@ -128,9 +129,9 @@ gst_smooth_class_init (GstSmoothClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_boolean ("active", "active", "active", TRUE, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOLERANCE, g_param_spec_int ("tolerance", "tolerance", "tolerance", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FILTERSIZE, g_param_spec_int ("filtersize", "filtersize", "filtersize", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_boolean ("active", "active", "active", TRUE, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOLERANCE, g_param_spec_int ("tolerance", "tolerance", "tolerance", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FILTERSIZE, g_param_spec_int ("filtersize", "filtersize", "filtersize", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_smooth_set_property; gobject_class->get_property = gst_smooth_get_property; @@ -207,16 +208,16 @@ smooth_filter (unsigned char *dest, unsigned char *src, int width, int height, fx2 = MIN (x + filtersize + 1, width) + fy1; for (fy = fy1; fy < fy2; fy += width) { - for (fx = fx1; fx < fx2; fx++) { - aktval = srcp[fx]; - if ((lowerval - aktval) * (upperval - aktval) < 0) { - numvalues++; - sum += aktval; - } - } /*for fx */ - fx1 += width; - fx2 += width; - } /*for fy */ + for (fx = fx1; fx < fx2; fx++) { + aktval = srcp[fx]; + if ((lowerval - aktval) * (upperval - aktval) < 0) { + numvalues++; + sum += aktval; + } + } /*for fx */ + fx1 += width; + fx2 += width; + } /*for fy */ src++; *dest++ = sum / numvalues; @@ -261,11 +262,11 @@ gst_smooth_chain (GstPad * pad, GstData * _data) smooth->tolerance, smooth->filtersize); if (!smooth->lum_only) { smooth_filter (GST_BUFFER_DATA (outbuf) + lumsize, data + lumsize, - smooth->width / 2, smooth->height / 2, smooth->tolerance, - smooth->filtersize / 2); + smooth->width / 2, smooth->height / 2, smooth->tolerance, + smooth->filtersize / 2); smooth_filter (GST_BUFFER_DATA (outbuf) + lumsize + chromsize, - data + lumsize + chromsize, smooth->width / 2, smooth->height / 2, - smooth->tolerance, smooth->filtersize / 2); + data + lumsize + chromsize, smooth->width / 2, smooth->height / 2, + smooth->tolerance, smooth->filtersize / 2); } else { memcpy (GST_BUFFER_DATA (outbuf) + lumsize, data + lumsize, chromsize * 2); } diff --git a/gst/smoothwave/gstsmoothwave.c b/gst/smoothwave/gstsmoothwave.c index 2abbdec2..9775e3d0 100644 --- a/gst/smoothwave/gstsmoothwave.c +++ b/gst/smoothwave/gstsmoothwave.c @@ -80,9 +80,10 @@ gst_smoothwave_get_type (void) 0, (GInstanceInitFunc) gst_smoothwave_init, }; + smoothwave_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSmoothWave", - &smoothwave_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSmoothWave", + &smoothwave_info, 0); } return smoothwave_type; } @@ -106,9 +107,9 @@ gst_smoothwave_class_init (GstSmoothWaveClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_READABLE)); /* CHECKME! */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_HEIGHT, g_param_spec_int ("height", "height", "height", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDGET, g_param_spec_object ("widget", "widget", "widget", GTK_TYPE_WIDGET, G_PARAM_READABLE)); /* CHECKME! */ gobject_class->set_property = gst_smoothwave_set_property; gobject_class->get_property = gst_smoothwave_get_property; @@ -192,7 +193,7 @@ gst_smoothwave_chain (GstPad * pad, GstData * _data) for (i = 0; i < MAX (smoothwave->width, samplecount); i++) { gint16 y1 = (gint32) (samples[i * 2] * qheight) / 32768 + qheight; gint16 y2 = (gint32) (samples[(i * 2) + 1] * qheight) / 32768 + - (qheight * 3); + (qheight * 3); smoothwave->imagebuffer[y1 * smoothwave->width + i] = 0xff; smoothwave->imagebuffer[y2 * smoothwave->width + i] = 0xff; /* smoothwave->imagebuffer[i+(smoothwave->width*5)] = i; */ @@ -246,16 +247,16 @@ gst_smoothwave_set_property (GObject * object, guint prop_id, case ARG_WIDTH: smoothwave->width = g_value_get_int (value); gtk_drawing_area_size (GTK_DRAWING_AREA (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); gtk_widget_set_usize (GTK_WIDGET (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); break; case ARG_HEIGHT: smoothwave->height = g_value_get_int (value); gtk_drawing_area_size (GTK_DRAWING_AREA (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); gtk_widget_set_usize (GTK_WIDGET (smoothwave->image), - smoothwave->width, smoothwave->height); + smoothwave->width, smoothwave->height); break; default: break; @@ -297,7 +298,7 @@ static gboolean plugin_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "smoothwave", GST_RANK_NONE, - GST_TYPE_SMOOTHWAVE)) + GST_TYPE_SMOOTHWAVE)) return FALSE; return TRUE; diff --git a/gst/smpte/barboxwipes.c b/gst/smpte/barboxwipes.c index 2508adf4..b843c97b 100644 --- a/gst/smpte/barboxwipes.c +++ b/gst/smpte/barboxwipes.c @@ -108,117 +108,117 @@ static gint box_clock_2b[][2 * 10] = { static gint box_clock_4b[][4 * 10] = { #define WIPE_B4_201 0 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, - BOX_CLOCK, 1, 1, 0, 1, 2, 2, 0, 1, 3, + BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, + BOX_CLOCK, 1, 1, 0, 1, 2, 2, 0, 1, 3, BOX_CLOCK, 1, 1, 0, 0, 1, 3, 1, 0, 4}, #define WIPE_B4_202 1 {BOX_CLOCK, 1, 1, 0, 1, 0, 3, 2, 1, 4, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, BOX_CLOCK, 1, 1, 0, 0, 1, 2, 1, 0, 3}, #define WIPE_B4_203 2 {BOX_CLOCK, 1, 1, 0, 1, 0, 2, 2, 1, 3, - BOX_CLOCK, 1, 1, 0, 2, 1, 3, 1, 2, 4, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 3, 1, 2, 4, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 0, 2}, #define WIPE_B4_204 3 {BOX_CLOCK, 1, 1, 0, 1, 0, 1, 2, 1, 2, - BOX_CLOCK, 1, 1, 0, 2, 1, 2, 1, 2, 3, - BOX_CLOCK, 1, 1, 0, 1, 2, 3, 0, 1, 4, + BOX_CLOCK, 1, 1, 0, 2, 1, 2, 1, 2, 3, + BOX_CLOCK, 1, 1, 0, 1, 2, 3, 0, 1, 4, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1}, #define WIPE_B4_205 4 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 0, 2}, #define WIPE_B4_206 5 {BOX_CLOCK, 1, 1, 0, 1, 0, 1, 2, 1, 2, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1}, #define WIPE_B4_207 6 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1}, #define WIPE_B4_211 7 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, - BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 1, 1, 2, 2, + BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 1, 1, 2, 2}, #define WIPE_B4_212 8 {BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 0, 1, - BOX_CLOCK, 1, 1, 0, 1, 0, 1, 0, 1, 2, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 1, 0, 1, 0, 1, 2, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, BOX_CLOCK, 1, 1, 0, 1, 2, 1, 0, 1, 2}, #define WIPE_B4_213 9 {BOX_CLOCK, 1, 1, 0, 1, 0, 0, 2, 1, 1, - BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, - BOX_CLOCK, 1, 1, 0, 1, 2, 0, 2, 1, 1, + BOX_CLOCK, 1, 1, 0, 1, 0, 0, 0, 1, 1, + BOX_CLOCK, 1, 1, 0, 1, 2, 0, 2, 1, 1, BOX_CLOCK, 1, 1, 0, 1, 2, 0, 0, 1, 1}, #define WIPE_B4_214 10 {BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 0, 1, - BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, - BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1, + BOX_CLOCK, 1, 1, 0, 2, 1, 0, 1, 2, 1, + BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 0, 1, BOX_CLOCK, 1, 1, 0, 0, 1, 0, 1, 2, 1}, #define WIPE_B4_227 11 {BOX_CLOCK, 1, 0, 0, 2, 0, 0, 1, 1, 1, - BOX_CLOCK, 1, 0, 0, 1, 1, 1, 0, 0, 2, - BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 1, 1, + BOX_CLOCK, 1, 0, 0, 1, 1, 1, 0, 0, 2, + BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 1, 1, BOX_CLOCK, 1, 2, 0, 1, 1, 1, 0, 2, 2}, #define WIPE_B4_228 12 {BOX_CLOCK, 0, 1, 0, 0, 0, 0, 1, 1, 1, - BOX_CLOCK, 0, 1, 0, 1, 1, 1, 0, 2, 2, - BOX_CLOCK, 2, 1, 0, 2, 0, 0, 1, 1, 1, + BOX_CLOCK, 0, 1, 0, 1, 1, 1, 0, 2, 2, + BOX_CLOCK, 2, 1, 0, 2, 0, 0, 1, 1, 1, BOX_CLOCK, 2, 1, 0, 1, 1, 1, 2, 2, 2}, #define WIPE_B4_235 13 {BOX_CLOCK, 1, 0, 0, 1, 1, 0, 0, 0, 1, - BOX_CLOCK, 1, 0, 0, 1, 1, 0, 2, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 1, 0, 2, 2, 1, + BOX_CLOCK, 1, 0, 0, 1, 1, 0, 2, 0, 1, + BOX_CLOCK, 1, 2, 0, 1, 1, 0, 2, 2, 1, BOX_CLOCK, 1, 2, 0, 1, 1, 0, 0, 2, 1}, #define WIPE_B4_236 14 {BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 0, 1, - BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 2, 1, - BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 0, 1, + BOX_CLOCK, 0, 1, 0, 1, 1, 0, 0, 2, 1, + BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 0, 1, BOX_CLOCK, 2, 1, 0, 1, 1, 0, 2, 2, 1}, }; static gint box_clock_8b[][8 * 10] = { #define WIPE_B8_261 0 {BOX_CLOCK, 2, 1, 0, 2, 2, 0, 4, 1, 1, - BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 0, 2, - BOX_CLOCK, 2, 1, 0, 2, 0, 2, 0, 1, 3, - BOX_CLOCK, 2, 1, 0, 0, 1, 3, 2, 2, 4, - BOX_CLOCK, 2, 3, 0, 2, 2, 0, 4, 3, 1, - BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 4, 2, - BOX_CLOCK, 2, 3, 0, 2, 4, 2, 0, 3, 3, + BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 0, 2, + BOX_CLOCK, 2, 1, 0, 2, 0, 2, 0, 1, 3, + BOX_CLOCK, 2, 1, 0, 0, 1, 3, 2, 2, 4, + BOX_CLOCK, 2, 3, 0, 2, 2, 0, 4, 3, 1, + BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 4, 2, + BOX_CLOCK, 2, 3, 0, 2, 4, 2, 0, 3, 3, BOX_CLOCK, 2, 3, 0, 0, 3, 3, 2, 2, 4}, #define WIPE_B8_262 1 {BOX_CLOCK, 1, 2, 0, 2, 2, 0, 1, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 0, 1, 0, 2, 2, - BOX_CLOCK, 1, 2, 0, 0, 2, 2, 1, 4, 3, - BOX_CLOCK, 1, 2, 0, 1, 4, 3, 2, 2, 4, - BOX_CLOCK, 3, 2, 0, 2, 2, 0, 3, 0, 1, - BOX_CLOCK, 3, 2, 0, 3, 0, 1, 4, 2, 2, - BOX_CLOCK, 3, 2, 0, 4, 2, 2, 3, 4, 3, + BOX_CLOCK, 1, 2, 0, 1, 0, 1, 0, 2, 2, + BOX_CLOCK, 1, 2, 0, 0, 2, 2, 1, 4, 3, + BOX_CLOCK, 1, 2, 0, 1, 4, 3, 2, 2, 4, + BOX_CLOCK, 3, 2, 0, 2, 2, 0, 3, 0, 1, + BOX_CLOCK, 3, 2, 0, 3, 0, 1, 4, 2, 2, + BOX_CLOCK, 3, 2, 0, 4, 2, 2, 3, 4, 3, BOX_CLOCK, 3, 2, 0, 3, 4, 3, 2, 2, 4}, #define WIPE_B8_263 2 {BOX_CLOCK, 2, 1, 0, 2, 0, 0, 4, 1, 1, - BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 2, 2, - BOX_CLOCK, 2, 1, 0, 2, 0, 0, 0, 1, 1, - BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 2, 2, - BOX_CLOCK, 2, 3, 0, 2, 4, 0, 4, 3, 1, - BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 2, 2, - BOX_CLOCK, 2, 3, 0, 2, 4, 0, 0, 3, 1, + BOX_CLOCK, 2, 1, 0, 4, 1, 1, 2, 2, 2, + BOX_CLOCK, 2, 1, 0, 2, 0, 0, 0, 1, 1, + BOX_CLOCK, 2, 1, 0, 0, 1, 1, 2, 2, 2, + BOX_CLOCK, 2, 3, 0, 2, 4, 0, 4, 3, 1, + BOX_CLOCK, 2, 3, 0, 4, 3, 1, 2, 2, 2, + BOX_CLOCK, 2, 3, 0, 2, 4, 0, 0, 3, 1, BOX_CLOCK, 2, 3, 0, 0, 3, 1, 2, 2, 2}, #define WIPE_B8_264 3 {BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 0, 1, - BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2, - BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 4, 1, - BOX_CLOCK, 1, 2, 0, 1, 4, 1, 2, 2, 2, - BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 0, 1, - BOX_CLOCK, 3, 2, 0, 3, 0, 1, 2, 2, 2, - BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 4, 1, + BOX_CLOCK, 1, 2, 0, 1, 0, 1, 2, 2, 2, + BOX_CLOCK, 1, 2, 0, 0, 2, 0, 1, 4, 1, + BOX_CLOCK, 1, 2, 0, 1, 4, 1, 2, 2, 2, + BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 0, 1, + BOX_CLOCK, 3, 2, 0, 3, 0, 1, 2, 2, 2, + BOX_CLOCK, 3, 2, 0, 4, 2, 0, 3, 4, 1, BOX_CLOCK, 3, 2, 0, 3, 4, 1, 2, 2, 2}, }; @@ -260,67 +260,67 @@ static gint triangles_3t[][3 * 9] = { /* 23 -> 26 */ #define WIPE_T3_23 0 {0, 0, 1, 1, 0, 0, 0, 2, 1, - 1, 0, 0, 0, 2, 1, 2, 2, 1, + 1, 0, 0, 0, 2, 1, 2, 2, 1, 1, 0, 0, 2, 0, 1, 2, 2, 1}, #define WIPE_T3_24 1 {0, 0, 1, 2, 0, 1, 2, 1, 0, - 0, 0, 1, 2, 1, 0, 0, 2, 1, + 0, 0, 1, 2, 1, 0, 0, 2, 1, 2, 1, 0, 0, 2, 1, 2, 2, 1}, #define WIPE_T3_25 2 {0, 0, 1, 0, 2, 1, 1, 2, 0, - 0, 0, 1, 2, 0, 1, 1, 2, 0, + 0, 0, 1, 2, 0, 1, 1, 2, 0, 2, 0, 1, 1, 2, 0, 2, 2, 1}, #define WIPE_T3_26 3 {0, 0, 1, 2, 0, 1, 0, 1, 0, - 2, 0, 1, 0, 1, 0, 2, 2, 1, + 2, 0, 1, 0, 1, 0, 2, 2, 1, 0, 1, 0, 0, 2, 1, 2, 2, 1}, }; static gint triangles_4t[][4 * 9] = { #define WIPE_T4_61 0 {0, 0, 1, 1, 0, 0, 1, 2, 1, - 0, 0, 1, 0, 2, 2, 1, 2, 1, - 1, 0, 0, 2, 0, 1, 1, 2, 1, + 0, 0, 1, 0, 2, 2, 1, 2, 1, + 1, 0, 0, 2, 0, 1, 1, 2, 1, 2, 0, 1, 1, 2, 1, 2, 2, 2}, #define WIPE_T4_62 1 {0, 0, 2, 2, 0, 1, 0, 1, 1, - 2, 0, 1, 0, 1, 1, 2, 1, 0, - 0, 1, 1, 2, 1, 0, 2, 2, 1, + 2, 0, 1, 0, 1, 1, 2, 1, 0, + 0, 1, 1, 2, 1, 0, 2, 2, 1, 0, 1, 1, 0, 2, 2, 2, 2, 1}, #define WIPE_T4_63 2 {0, 0, 2, 1, 0, 1, 0, 2, 1, - 1, 0, 1, 0, 2, 1, 1, 2, 0, - 1, 0, 1, 1, 2, 0, 2, 2, 1, + 1, 0, 1, 0, 2, 1, 1, 2, 0, + 1, 0, 1, 1, 2, 0, 2, 2, 1, 1, 0, 1, 2, 0, 2, 2, 2, 1}, #define WIPE_T4_64 3 {0, 0, 1, 2, 0, 2, 2, 1, 1, - 0, 0, 1, 0, 1, 0, 2, 1, 1, - 0, 1, 0, 2, 1, 1, 0, 2, 1, + 0, 0, 1, 0, 1, 0, 2, 1, 1, + 0, 1, 0, 2, 1, 1, 0, 2, 1, 2, 1, 1, 0, 2, 1, 2, 2, 2}, #define WIPE_T4_65 4 {0, 0, 0, 1, 0, 1, 1, 2, 0, - 0, 0, 0, 0, 2, 1, 1, 2, 0, - 1, 0, 1, 2, 0, 0, 1, 2, 0, + 0, 0, 0, 0, 2, 1, 1, 2, 0, + 1, 0, 1, 2, 0, 0, 1, 2, 0, 2, 0, 0, 1, 2, 0, 2, 2, 1}, #define WIPE_T4_66 5 {0, 0, 1, 2, 0, 0, 0, 1, 0, - 2, 0, 0, 0, 1, 0, 2, 1, 1, - 0, 1, 0, 2, 1, 1, 2, 2, 0, + 2, 0, 0, 0, 1, 0, 2, 1, 1, + 0, 1, 0, 2, 1, 1, 2, 2, 0, 0, 1, 0, 0, 2, 1, 2, 2, 0}, #define WIPE_T4_67 6 {0, 0, 1, 1, 0, 0, 0, 2, 0, - 1, 0, 0, 0, 2, 0, 1, 2, 1, - 1, 0, 0, 1, 2, 1, 2, 2, 0, + 1, 0, 0, 0, 2, 0, 1, 2, 1, + 1, 0, 0, 1, 2, 1, 2, 2, 0, 1, 0, 0, 2, 0, 1, 2, 2, 0}, #define WIPE_T4_68 7 {0, 0, 0, 2, 0, 1, 2, 1, 0, - 0, 0, 0, 0, 1, 1, 2, 1, 0, - 0, 1, 1, 2, 1, 0, 0, 2, 0, + 0, 0, 0, 0, 1, 1, 2, 1, 0, + 0, 1, 1, 2, 1, 0, 0, 2, 0, 2, 1, 0, 0, 2, 0, 2, 2, 1}, #define WIPE_T4_101 8 {0, 0, 1, 2, 0, 1, 1, 1, 0, - 0, 0, 1, 1, 1, 0, 0, 2, 1, - 1, 1, 0, 0, 2, 1, 2, 2, 1, + 0, 0, 1, 1, 1, 0, 0, 2, 1, + 1, 1, 0, 0, 2, 1, 2, 2, 1, 2, 0, 1, 1, 1, 0, 2, 2, 1}, }; @@ -328,48 +328,48 @@ static gint triangles_8t[][8 * 9] = { /* 7 */ #define WIPE_T8_7 0 {0, 0, 0, 1, 0, 1, 1, 1, 1, - 1, 0, 1, 2, 0, 0, 1, 1, 1, - 2, 0, 0, 1, 1, 1, 2, 1, 1, - 1, 1, 1, 2, 1, 1, 2, 2, 0, - 1, 1, 1, 1, 2, 1, 2, 2, 0, - 1, 1, 1, 0, 2, 0, 1, 2, 1, - 0, 1, 1, 1, 1, 1, 0, 2, 0, + 1, 0, 1, 2, 0, 0, 1, 1, 1, + 2, 0, 0, 1, 1, 1, 2, 1, 1, + 1, 1, 1, 2, 1, 1, 2, 2, 0, + 1, 1, 1, 1, 2, 1, 2, 2, 0, + 1, 1, 1, 0, 2, 0, 1, 2, 1, + 0, 1, 1, 1, 1, 1, 0, 2, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1}, #define WIPE_T8_43 1 {0, 0, 1, 1, 0, 0, 1, 1, 1, - 1, 0, 0, 2, 0, 1, 1, 1, 1, - 2, 0, 1, 1, 1, 1, 2, 1, 2, - 1, 1, 1, 2, 1, 2, 2, 2, 1, - 1, 1, 1, 1, 2, 0, 2, 2, 1, - 1, 1, 1, 0, 2, 1, 1, 2, 0, - 0, 1, 2, 1, 1, 1, 0, 2, 1, + 1, 0, 0, 2, 0, 1, 1, 1, 1, + 2, 0, 1, 1, 1, 1, 2, 1, 2, + 1, 1, 1, 2, 1, 2, 2, 2, 1, + 1, 1, 1, 1, 2, 0, 2, 2, 1, + 1, 1, 1, 0, 2, 1, 1, 2, 0, + 0, 1, 2, 1, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 2, 1, 1, 1}, #define WIPE_T8_44 2 {0, 0, 1, 1, 0, 2, 1, 1, 1, - 1, 0, 2, 2, 0, 1, 1, 1, 1, - 2, 0, 1, 1, 1, 1, 2, 1, 0, - 1, 1, 1, 2, 1, 0, 2, 2, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 1, - 1, 1, 1, 0, 2, 1, 1, 2, 2, - 0, 1, 0, 1, 1, 1, 0, 2, 1, + 1, 0, 2, 2, 0, 1, 1, 1, 1, + 2, 0, 1, 1, 1, 1, 2, 1, 0, + 1, 1, 1, 2, 1, 0, 2, 2, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 1, + 1, 1, 1, 0, 2, 1, 1, 2, 2, + 0, 1, 0, 1, 1, 1, 0, 2, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1}, #define WIPE_T8_47 3 {0, 0, 0, 1, 0, 1, 1, 1, 0, - 1, 0, 1, 2, 0, 0, 1, 1, 0, - 2, 0, 0, 1, 1, 0, 2, 1, 1, - 1, 1, 0, 2, 1, 1, 2, 2, 0, - 1, 1, 0, 1, 2, 1, 2, 2, 0, - 1, 1, 0, 0, 2, 0, 1, 2, 1, - 0, 1, 1, 1, 1, 0, 0, 2, 0, + 1, 0, 1, 2, 0, 0, 1, 1, 0, + 2, 0, 0, 1, 1, 0, 2, 1, 1, + 1, 1, 0, 2, 1, 1, 2, 2, 0, + 1, 1, 0, 1, 2, 1, 2, 2, 0, + 1, 1, 0, 0, 2, 0, 1, 2, 1, + 0, 1, 1, 1, 1, 0, 0, 2, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0}, #define WIPE_T8_48 4 {0, 0, 1, 1, 0, 0, 0, 1, 0, - 1, 0, 0, 0, 1, 0, 1, 1, 1, - 1, 0, 0, 2, 0, 1, 2, 1, 0, - 1, 0, 0, 1, 1, 1, 2, 1, 0, - 0, 1, 0, 1, 1, 1, 1, 2, 0, - 0, 1, 0, 0, 2, 1, 1, 2, 0, - 1, 1, 1, 2, 1, 0, 1, 2, 0, + 1, 0, 0, 0, 1, 0, 1, 1, 1, + 1, 0, 0, 2, 0, 1, 2, 1, 0, + 1, 0, 0, 1, 1, 1, 2, 1, 0, + 0, 1, 0, 1, 1, 1, 1, 2, 0, + 0, 1, 0, 0, 2, 1, 1, 2, 0, + 1, 1, 1, 2, 1, 0, 1, 2, 0, 2, 1, 0, 1, 2, 0, 2, 2, 1}, }; @@ -377,20 +377,20 @@ static gint triangles_16t[][16 * 9] = { /* 8 */ #define WIPE_T16_8 0 {0, 0, 1, 2, 0, 1, 1, 1, 0, - 2, 0, 1, 1, 1, 0, 2, 2, 1, - 1, 1, 0, 0, 2, 1, 2, 2, 1, - 0, 0, 1, 1, 1, 0, 0, 2, 1, - 2, 0, 1, 4, 0, 1, 3, 1, 0, - 4, 0, 1, 3, 1, 0, 4, 2, 1, - 3, 1, 0, 2, 2, 1, 4, 2, 1, - 2, 0, 1, 3, 1, 0, 2, 2, 1, - 0, 2, 1, 2, 2, 1, 1, 3, 0, - 2, 2, 1, 1, 3, 0, 2, 4, 1, - 1, 3, 0, 0, 4, 1, 2, 4, 1, - 0, 2, 1, 1, 3, 0, 0, 4, 1, - 2, 2, 1, 4, 2, 1, 3, 3, 0, - 4, 2, 1, 3, 3, 0, 4, 4, 1, - 3, 3, 0, 2, 4, 1, 4, 4, 1, + 2, 0, 1, 1, 1, 0, 2, 2, 1, + 1, 1, 0, 0, 2, 1, 2, 2, 1, + 0, 0, 1, 1, 1, 0, 0, 2, 1, + 2, 0, 1, 4, 0, 1, 3, 1, 0, + 4, 0, 1, 3, 1, 0, 4, 2, 1, + 3, 1, 0, 2, 2, 1, 4, 2, 1, + 2, 0, 1, 3, 1, 0, 2, 2, 1, + 0, 2, 1, 2, 2, 1, 1, 3, 0, + 2, 2, 1, 1, 3, 0, 2, 4, 1, + 1, 3, 0, 0, 4, 1, 2, 4, 1, + 0, 2, 1, 1, 3, 0, 0, 4, 1, + 2, 2, 1, 4, 2, 1, 3, 3, 0, + 4, 2, 1, 3, 3, 0, 4, 4, 1, + 3, 3, 0, 2, 4, 1, 4, 4, 1, 2, 2, 1, 3, 3, 0, 2, 4, 1} }; @@ -407,148 +407,148 @@ struct _GstWipeConfig static GstWipeConfig wipe_config[] = { #define WIPE_CONFIG_1 0 - {boxes_1b[WIPE_B1_1], 1, 0, 0, 0}, /* 1 */ + {boxes_1b[WIPE_B1_1], 1, 0, 0, 0}, /* 1 */ #define WIPE_CONFIG_2 WIPE_CONFIG_1+1 - {boxes_1b[WIPE_B1_2], 1, 0, 0, 0}, /* 2 */ + {boxes_1b[WIPE_B1_2], 1, 0, 0, 0}, /* 2 */ #define WIPE_CONFIG_3 WIPE_CONFIG_2+1 - {triangles_2t[WIPE_T2_3], 2, 0, 0, 0}, /* 3 */ + {triangles_2t[WIPE_T2_3], 2, 0, 0, 0}, /* 3 */ #define WIPE_CONFIG_4 WIPE_CONFIG_3+1 - {triangles_2t[WIPE_T2_4], 2, 0, 0, 0}, /* 4 */ + {triangles_2t[WIPE_T2_4], 2, 0, 0, 0}, /* 4 */ #define WIPE_CONFIG_5 WIPE_CONFIG_4+1 - {triangles_2t[WIPE_T2_5], 2, 0, 0, 0}, /* 5 */ + {triangles_2t[WIPE_T2_5], 2, 0, 0, 0}, /* 5 */ #define WIPE_CONFIG_6 WIPE_CONFIG_5+1 - {triangles_2t[WIPE_T2_6], 2, 0, 0, 0}, /* 6 */ + {triangles_2t[WIPE_T2_6], 2, 0, 0, 0}, /* 6 */ #define WIPE_CONFIG_7 WIPE_CONFIG_6+1 - {triangles_8t[WIPE_T8_7], 8, 1, 1, 0}, /* 7 */ + {triangles_8t[WIPE_T8_7], 8, 1, 1, 0}, /* 7 */ #define WIPE_CONFIG_8 WIPE_CONFIG_7+1 - {triangles_16t[WIPE_T16_8], 16, 2, 2, 0}, /* 8 */ + {triangles_16t[WIPE_T16_8], 16, 2, 2, 0}, /* 8 */ #define WIPE_CONFIG_21 WIPE_CONFIG_8+1 - {boxes_2b[WIPE_B2_21], 2, 1, 1, 0}, /* 21 */ + {boxes_2b[WIPE_B2_21], 2, 1, 1, 0}, /* 21 */ #define WIPE_CONFIG_22 WIPE_CONFIG_21+1 - {boxes_2b[WIPE_B2_22], 2, 1, 1, 0}, /* 22 */ + {boxes_2b[WIPE_B2_22], 2, 1, 1, 0}, /* 22 */ #define WIPE_CONFIG_23 WIPE_CONFIG_22+1 - {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 23 */ + {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 23 */ #define WIPE_CONFIG_24 WIPE_CONFIG_23+1 - {triangles_3t[WIPE_T3_24], 3, 1, 1, 0}, /* 24 */ + {triangles_3t[WIPE_T3_24], 3, 1, 1, 0}, /* 24 */ #define WIPE_CONFIG_25 WIPE_CONFIG_24+1 - {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 25 */ + {triangles_3t[WIPE_T3_23], 3, 1, 1, 0}, /* 25 */ #define WIPE_CONFIG_26 WIPE_CONFIG_25+1 - {triangles_3t[WIPE_T3_26], 3, 1, 1, 0}, /* 26 */ + {triangles_3t[WIPE_T3_26], 3, 1, 1, 0}, /* 26 */ #define WIPE_CONFIG_41 WIPE_CONFIG_26+1 - {triangles_2t[WIPE_T2_41], 2, 0, 0, 1}, /* 41 */ + {triangles_2t[WIPE_T2_41], 2, 0, 0, 1}, /* 41 */ #define WIPE_CONFIG_42 WIPE_CONFIG_41+1 - {triangles_2t[WIPE_T2_42], 2, 0, 0, 1}, /* 42 */ + {triangles_2t[WIPE_T2_42], 2, 0, 0, 1}, /* 42 */ #define WIPE_CONFIG_43 WIPE_CONFIG_42+1 - {triangles_8t[WIPE_T8_43], 8, 1, 1, 1}, /* 43 */ + {triangles_8t[WIPE_T8_43], 8, 1, 1, 1}, /* 43 */ #define WIPE_CONFIG_44 WIPE_CONFIG_43+1 - {triangles_8t[WIPE_T8_44], 8, 1, 1, 1}, /* 44 */ + {triangles_8t[WIPE_T8_44], 8, 1, 1, 1}, /* 44 */ #define WIPE_CONFIG_45 WIPE_CONFIG_44+1 - {triangles_2t[WIPE_T2_45], 2, 0, 0, 0}, /* 45 */ + {triangles_2t[WIPE_T2_45], 2, 0, 0, 0}, /* 45 */ #define WIPE_CONFIG_46 WIPE_CONFIG_45+1 - {triangles_2t[WIPE_T2_46], 2, 0, 0, 0}, /* 46 */ + {triangles_2t[WIPE_T2_46], 2, 0, 0, 0}, /* 46 */ #define WIPE_CONFIG_47 WIPE_CONFIG_46+1 - {triangles_8t[WIPE_T8_47], 8, 1, 1, 0}, /* 47 */ + {triangles_8t[WIPE_T8_47], 8, 1, 1, 0}, /* 47 */ #define WIPE_CONFIG_48 WIPE_CONFIG_47+1 - {triangles_8t[WIPE_T8_48], 8, 1, 1, 0}, /* 48 */ + {triangles_8t[WIPE_T8_48], 8, 1, 1, 0}, /* 48 */ #define WIPE_CONFIG_61 WIPE_CONFIG_48+1 - {triangles_4t[WIPE_T4_61], 4, 1, 1, 1}, /* 61 */ + {triangles_4t[WIPE_T4_61], 4, 1, 1, 1}, /* 61 */ #define WIPE_CONFIG_62 WIPE_CONFIG_61+1 - {triangles_4t[WIPE_T4_62], 4, 1, 1, 1}, /* 62 */ + {triangles_4t[WIPE_T4_62], 4, 1, 1, 1}, /* 62 */ #define WIPE_CONFIG_63 WIPE_CONFIG_62+1 - {triangles_4t[WIPE_T4_63], 4, 1, 1, 1}, /* 63 */ + {triangles_4t[WIPE_T4_63], 4, 1, 1, 1}, /* 63 */ #define WIPE_CONFIG_64 WIPE_CONFIG_63+1 - {triangles_4t[WIPE_T4_64], 4, 1, 1, 1}, /* 64 */ + {triangles_4t[WIPE_T4_64], 4, 1, 1, 1}, /* 64 */ #define WIPE_CONFIG_65 WIPE_CONFIG_64+1 - {triangles_4t[WIPE_T4_65], 4, 1, 1, 0}, /* 65 */ + {triangles_4t[WIPE_T4_65], 4, 1, 1, 0}, /* 65 */ #define WIPE_CONFIG_66 WIPE_CONFIG_65+1 - {triangles_4t[WIPE_T4_66], 4, 1, 1, 0}, /* 66 */ + {triangles_4t[WIPE_T4_66], 4, 1, 1, 0}, /* 66 */ #define WIPE_CONFIG_67 WIPE_CONFIG_66+1 - {triangles_4t[WIPE_T4_67], 4, 1, 1, 0}, /* 67 */ + {triangles_4t[WIPE_T4_67], 4, 1, 1, 0}, /* 67 */ #define WIPE_CONFIG_68 WIPE_CONFIG_67+1 - {triangles_4t[WIPE_T4_68], 4, 1, 1, 0}, /* 68 */ + {triangles_4t[WIPE_T4_68], 4, 1, 1, 0}, /* 68 */ #define WIPE_CONFIG_101 WIPE_CONFIG_68+1 - {triangles_4t[WIPE_T4_101], 4, 1, 1, 0}, /* 101 */ + {triangles_4t[WIPE_T4_101], 4, 1, 1, 0}, /* 101 */ #define WIPE_CONFIG_201 WIPE_CONFIG_101+1 - {box_clock_4b[WIPE_B4_201], 4, 1, 1, 2}, /* 201 */ + {box_clock_4b[WIPE_B4_201], 4, 1, 1, 2}, /* 201 */ #define WIPE_CONFIG_202 WIPE_CONFIG_201+1 - {box_clock_4b[WIPE_B4_202], 4, 1, 1, 2}, /* 202 */ + {box_clock_4b[WIPE_B4_202], 4, 1, 1, 2}, /* 202 */ #define WIPE_CONFIG_203 WIPE_CONFIG_202+1 - {box_clock_4b[WIPE_B4_203], 4, 1, 1, 2}, /* 203 */ + {box_clock_4b[WIPE_B4_203], 4, 1, 1, 2}, /* 203 */ #define WIPE_CONFIG_204 WIPE_CONFIG_203+1 - {box_clock_4b[WIPE_B4_204], 4, 1, 1, 2}, /* 204 */ + {box_clock_4b[WIPE_B4_204], 4, 1, 1, 2}, /* 204 */ #define WIPE_CONFIG_205 WIPE_CONFIG_204+1 - {box_clock_4b[WIPE_B4_205], 4, 1, 1, 1}, /* 205 */ + {box_clock_4b[WIPE_B4_205], 4, 1, 1, 1}, /* 205 */ #define WIPE_CONFIG_206 WIPE_CONFIG_205+1 - {box_clock_4b[WIPE_B4_206], 4, 1, 1, 1}, /* 206 */ + {box_clock_4b[WIPE_B4_206], 4, 1, 1, 1}, /* 206 */ #define WIPE_CONFIG_207 WIPE_CONFIG_206+1 - {box_clock_4b[WIPE_B4_207], 4, 1, 1, 0}, /* 207 */ + {box_clock_4b[WIPE_B4_207], 4, 1, 1, 0}, /* 207 */ #define WIPE_CONFIG_211 WIPE_CONFIG_207+1 - {box_clock_4b[WIPE_B4_211], 4, 1, 1, 1}, /* 211 */ + {box_clock_4b[WIPE_B4_211], 4, 1, 1, 1}, /* 211 */ #define WIPE_CONFIG_212 WIPE_CONFIG_211+1 - {box_clock_4b[WIPE_B4_212], 4, 1, 1, 1}, /* 212 */ + {box_clock_4b[WIPE_B4_212], 4, 1, 1, 1}, /* 212 */ #define WIPE_CONFIG_213 WIPE_CONFIG_212+1 - {box_clock_4b[WIPE_B4_213], 4, 1, 1, 0}, /* 213 */ + {box_clock_4b[WIPE_B4_213], 4, 1, 1, 0}, /* 213 */ #define WIPE_CONFIG_214 WIPE_CONFIG_213+1 - {box_clock_4b[WIPE_B4_214], 4, 1, 1, 0}, /* 214 */ + {box_clock_4b[WIPE_B4_214], 4, 1, 1, 0}, /* 214 */ #define WIPE_CONFIG_221 WIPE_CONFIG_214+1 - {box_clock_2b[WIPE_B2_221], 2, 1, 1, 1}, /* 221 */ + {box_clock_2b[WIPE_B2_221], 2, 1, 1, 1}, /* 221 */ #define WIPE_CONFIG_222 WIPE_CONFIG_221+1 - {box_clock_2b[WIPE_B2_222], 2, 1, 1, 1}, /* 222 */ + {box_clock_2b[WIPE_B2_222], 2, 1, 1, 1}, /* 222 */ #define WIPE_CONFIG_223 WIPE_CONFIG_222+1 - {box_clock_2b[WIPE_B2_223], 2, 1, 1, 1}, /* 223 */ + {box_clock_2b[WIPE_B2_223], 2, 1, 1, 1}, /* 223 */ #define WIPE_CONFIG_224 WIPE_CONFIG_223+1 - {box_clock_2b[WIPE_B2_224], 2, 1, 1, 1}, /* 224 */ + {box_clock_2b[WIPE_B2_224], 2, 1, 1, 1}, /* 224 */ #define WIPE_CONFIG_225 WIPE_CONFIG_224+1 - {box_clock_2b[WIPE_B2_225], 2, 1, 1, 0}, /* 225 */ + {box_clock_2b[WIPE_B2_225], 2, 1, 1, 0}, /* 225 */ #define WIPE_CONFIG_226 WIPE_CONFIG_225+1 - {box_clock_2b[WIPE_B2_226], 2, 1, 1, 0}, /* 226 */ + {box_clock_2b[WIPE_B2_226], 2, 1, 1, 0}, /* 226 */ #define WIPE_CONFIG_227 WIPE_CONFIG_226+1 - {box_clock_4b[WIPE_B4_227], 4, 1, 1, 1}, /* 227 */ + {box_clock_4b[WIPE_B4_227], 4, 1, 1, 1}, /* 227 */ #define WIPE_CONFIG_228 WIPE_CONFIG_227+1 - {box_clock_4b[WIPE_B4_228], 4, 1, 1, 1}, /* 228 */ + {box_clock_4b[WIPE_B4_228], 4, 1, 1, 1}, /* 228 */ #define WIPE_CONFIG_231 WIPE_CONFIG_228+1 - {box_clock_2b[WIPE_B2_231], 2, 1, 1, 0}, /* 231 */ + {box_clock_2b[WIPE_B2_231], 2, 1, 1, 0}, /* 231 */ #define WIPE_CONFIG_232 WIPE_CONFIG_231+1 - {box_clock_2b[WIPE_B2_232], 2, 1, 1, 0}, /* 232 */ + {box_clock_2b[WIPE_B2_232], 2, 1, 1, 0}, /* 232 */ #define WIPE_CONFIG_233 WIPE_CONFIG_232+1 - {box_clock_2b[WIPE_B2_233], 2, 1, 1, 0}, /* 233 */ + {box_clock_2b[WIPE_B2_233], 2, 1, 1, 0}, /* 233 */ #define WIPE_CONFIG_234 WIPE_CONFIG_233+1 - {box_clock_2b[WIPE_B2_234], 2, 1, 1, 0}, /* 234 */ + {box_clock_2b[WIPE_B2_234], 2, 1, 1, 0}, /* 234 */ #define WIPE_CONFIG_235 WIPE_CONFIG_234+1 - {box_clock_4b[WIPE_B4_235], 4, 1, 1, 0}, /* 235 */ + {box_clock_4b[WIPE_B4_235], 4, 1, 1, 0}, /* 235 */ #define WIPE_CONFIG_236 WIPE_CONFIG_235+1 - {box_clock_4b[WIPE_B4_236], 4, 1, 1, 0}, /* 236 */ + {box_clock_4b[WIPE_B4_236], 4, 1, 1, 0}, /* 236 */ #define WIPE_CONFIG_241 WIPE_CONFIG_236+1 - {box_clock_1b[WIPE_B1_241], 1, 0, 0, 0}, /* 241 */ + {box_clock_1b[WIPE_B1_241], 1, 0, 0, 0}, /* 241 */ #define WIPE_CONFIG_242 WIPE_CONFIG_241+1 - {box_clock_1b[WIPE_B1_242], 1, 0, 0, 0}, /* 242 */ + {box_clock_1b[WIPE_B1_242], 1, 0, 0, 0}, /* 242 */ #define WIPE_CONFIG_243 WIPE_CONFIG_242+1 - {box_clock_1b[WIPE_B1_243], 1, 0, 0, 0}, /* 243 */ + {box_clock_1b[WIPE_B1_243], 1, 0, 0, 0}, /* 243 */ #define WIPE_CONFIG_244 WIPE_CONFIG_243+1 - {box_clock_1b[WIPE_B1_244], 1, 0, 0, 0}, /* 244 */ + {box_clock_1b[WIPE_B1_244], 1, 0, 0, 0}, /* 244 */ #define WIPE_CONFIG_245 WIPE_CONFIG_244+1 - {triangles_2t[WIPE_T2_245], 2, 1, 1, 0}, /* 245 */ + {triangles_2t[WIPE_T2_245], 2, 1, 1, 0}, /* 245 */ #define WIPE_CONFIG_246 WIPE_CONFIG_245+1 - {triangles_2t[WIPE_T2_246], 2, 1, 1, 0}, /* 246 */ + {triangles_2t[WIPE_T2_246], 2, 1, 1, 0}, /* 246 */ #define WIPE_CONFIG_251 WIPE_CONFIG_246+1 - {box_clock_2b[WIPE_B2_251], 2, 1, 1, 0}, /* 251 */ + {box_clock_2b[WIPE_B2_251], 2, 1, 1, 0}, /* 251 */ #define WIPE_CONFIG_252 WIPE_CONFIG_251+1 - {box_clock_2b[WIPE_B2_252], 2, 1, 1, 0}, /* 252 */ + {box_clock_2b[WIPE_B2_252], 2, 1, 1, 0}, /* 252 */ #define WIPE_CONFIG_253 WIPE_CONFIG_252+1 - {box_clock_2b[WIPE_B2_253], 2, 1, 1, 0}, /* 253 */ + {box_clock_2b[WIPE_B2_253], 2, 1, 1, 0}, /* 253 */ #define WIPE_CONFIG_254 WIPE_CONFIG_253+1 - {box_clock_2b[WIPE_B2_254], 2, 1, 1, 0}, /* 254 */ + {box_clock_2b[WIPE_B2_254], 2, 1, 1, 0}, /* 254 */ #define WIPE_CONFIG_261 WIPE_CONFIG_254+1 - {box_clock_8b[WIPE_B8_261], 8, 2, 2, 2}, /* 261 */ + {box_clock_8b[WIPE_B8_261], 8, 2, 2, 2}, /* 261 */ #define WIPE_CONFIG_262 WIPE_CONFIG_261+1 - {box_clock_8b[WIPE_B8_262], 8, 2, 2, 2}, /* 262 */ + {box_clock_8b[WIPE_B8_262], 8, 2, 2, 2}, /* 262 */ #define WIPE_CONFIG_263 WIPE_CONFIG_262+1 - {box_clock_8b[WIPE_B8_263], 8, 2, 2, 1}, /* 263 */ + {box_clock_8b[WIPE_B8_263], 8, 2, 2, 1}, /* 263 */ #define WIPE_CONFIG_264 WIPE_CONFIG_263+1 - {box_clock_8b[WIPE_B8_264], 8, 2, 2, 1}, /* 264 */ + {box_clock_8b[WIPE_B8_264], 8, 2, 2, 1}, /* 264 */ }; static void @@ -565,24 +565,24 @@ gst_wipe_boxes_draw (GstMask * mask) for (i = 0; i < config->nobjects; i++) { switch (impacts[0]) { case BOX_VERTICAL: - gst_smpte_paint_vbox (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth); - impacts += 7; - break; + gst_smpte_paint_vbox (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth); + impacts += 7; + break; case BOX_HORIZONTAL: - gst_smpte_paint_hbox (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth); - impacts += 7; + gst_smpte_paint_hbox (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth); + impacts += 7; case BOX_CLOCK: - gst_smpte_paint_box_clock (mask->data, mask->width, - impacts[1] * width, impacts[2] * height, impacts[3] * depth, - impacts[4] * width, impacts[5] * height, impacts[6] * depth, - impacts[7] * width, impacts[8] * height, impacts[9] * depth); - impacts += 10; + gst_smpte_paint_box_clock (mask->data, mask->width, + impacts[1] * width, impacts[2] * height, impacts[3] * depth, + impacts[4] * width, impacts[5] * height, impacts[6] * depth, + impacts[7] * width, impacts[8] * height, impacts[9] * depth); + impacts += 10; default: - break; + break; } } } @@ -599,9 +599,9 @@ gst_wipe_triangles_clock_draw (GstMask * mask) for (i = 0; i < config->nobjects; i++) { gst_smpte_paint_triangle_clock (mask->data, mask->width, - impacts[0] * width, impacts[1] * height, impacts[2] * depth, - impacts[3] * width, impacts[4] * height, impacts[5] * depth, - impacts[6] * width, impacts[7] * height, impacts[8] * depth); + impacts[0] * width, impacts[1] * height, impacts[2] * depth, + impacts[3] * width, impacts[4] * height, impacts[5] * depth, + impacts[6] * width, impacts[7] * height, impacts[8] * depth); impacts += 9; } } @@ -619,293 +619,293 @@ gst_wipe_triangles_draw (GstMask * mask) for (i = 0; i < config->nobjects; i++) { gst_smpte_paint_triangle_linear (mask->data, mask->width, - impacts[0] * width, impacts[1] * height, impacts[2] * depth, - impacts[3] * width, impacts[4] * height, impacts[5] * depth, - impacts[6] * width, impacts[7] * height, impacts[8] * depth); + impacts[0] * width, impacts[1] * height, impacts[2] * depth, + impacts[3] * width, impacts[4] * height, impacts[5] * depth, + impacts[6] * width, impacts[7] * height, impacts[8] * depth); impacts += 9; } } static GstMaskDefinition definitions[] = { {1, "bar_wipe_lr", - "A bar moves from left to right", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A bar moves from left to right", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_1]}, {2, "bar_wipe_tb", - "A bar moves from top to bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A bar moves from top to bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_2]}, {3, "box_wipe_tl", - "A box expands from the upper-left corner to the lower-right corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the upper-left corner to the lower-right corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_3]}, {4, "box_wipe_tr", - "A box expands from the upper-right corner to the lower-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the upper-right corner to the lower-left corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_4]}, {5, "box_wipe_br", - "A box expands from the lower-right corner to the upper-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the lower-right corner to the upper-left corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_5]}, {6, "box_wipe_bl", - "A box expands from the lower-left corner to the upper-right corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the lower-left corner to the upper-right corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_6]}, {7, "four_box_wipe_ci", - "A box shape expands from each of the four corners toward the center", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box shape expands from each of the four corners toward the center", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_7]}, {8, "four_box_wipe_co", - "A box shape expands from the center of each quadrant toward the corners of each quadrant", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box shape expands from the center of each quadrant toward the corners of each quadrant", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_8]}, {21, "barndoor_v", - "A central, vertical line splits and expands toward the left and right edges", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A central, vertical line splits and expands toward the left and right edges", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_21]}, {22, "barndoor_h", - "A central, horizontal line splits and expands toward the top and bottom edges", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A central, horizontal line splits and expands toward the top and bottom edges", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_22]}, {23, "box_wipe_tc", - "A box expands from the top edge's midpoint to the bottom corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the top edge's midpoint to the bottom corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_23]}, {24, "box_wipe_rc", - "A box expands from the right edge's midpoint to the left corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the right edge's midpoint to the left corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_24]}, {25, "box_wipe_bc", - "A box expands from the bottom edge's midpoint to the top corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the bottom edge's midpoint to the top corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_25]}, {26, "box_wipe_lc", - "A box expands from the left edge's midpoint to the right corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A box expands from the left edge's midpoint to the right corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_26]}, {41, "diagonal_tl", - "A diagonal line moves from the upper-left corner to the lower-right corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line moves from the upper-left corner to the lower-right corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_41]}, {42, "diagonal_tr", - "A diagonal line moves from the upper right corner to the lower-left corner", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line moves from the upper right corner to the lower-left corner", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_42]}, {43, "bowtie_v", - "Two wedge shapes slide in from the top and bottom edges toward the center", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "Two wedge shapes slide in from the top and bottom edges toward the center", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_43]}, {44, "bowtie_h", - "Two wedge shapes slide in from the left and right edges toward the center", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "Two wedge shapes slide in from the left and right edges toward the center", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_44]}, {45, "barndoor_dbl", - "A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line from the lower-left to upper-right corners splits and expands toward the opposite corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_45]}, {46, "barndoor_dtl", - "A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diagonal line from upper-left to lower-right corners splits and expands toward the opposite corners", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_46]}, {47, "misc_diagonal_dbd", - "Four wedge shapes split from the center and retract toward the four edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "Four wedge shapes split from the center and retract toward the four edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_47]}, {48, "misc_diagonal_dd", - "A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A diamond connecting the four edge midpoints simultaneously contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_48]}, {61, "vee_d", - "A wedge shape moves from top to bottom", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from top to bottom", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_61]}, {62, "vee_l", - "A wedge shape moves from right to left", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from right to left", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_62]}, {63, "vee_u", - "A wedge shape moves from bottom to top", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from bottom to top", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_63]}, {64, "vee_r", - "A wedge shape moves from left to right", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A wedge shape moves from left to right", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_64]}, {65, "barnvee_d", - "A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the bottom edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_65]}, {66, "barnvee_l", - "A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the left edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_66]}, {67, "barnvee_u", - "A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the top edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_67]}, {68, "barnvee_r", - "A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A 'V' shape extending from the right edge's midpoint to the opposite corners contracts toward the center and expands toward the edges", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_68]}, {101, "iris_rect", - "A rectangle expands from the center.", - gst_wipe_triangles_draw, _gst_mask_default_destroy, + "A rectangle expands from the center.", + gst_wipe_triangles_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_101]}, {201, "clock_cw12", - "A radial hand sweeps clockwise from the twelve o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the twelve o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_201]}, {202, "clock_cw3", - "A radial hand sweeps clockwise from the three o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the three o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_202]}, {203, "clock_cw6", - "A radial hand sweeps clockwise from the six o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the six o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_203]}, {204, "clock_cw9", - "A radial hand sweeps clockwise from the nine o'clock position", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the nine o'clock position", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_204]}, {205, "pinwheel_tbv", - "Two radial hands sweep clockwise from the twelve and six o'clock positions", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise from the twelve and six o'clock positions", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_205]}, {206, "pinwheel_tbh", - "Two radial hands sweep clockwise from the nine and three o'clock positions", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise from the nine and three o'clock positions", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_206]}, {207, "pinwheel_fb", - "Four radial hands sweep clockwise", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Four radial hands sweep clockwise", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_207]}, {211, "fan_ct", - "A fan unfolds from the top edge, the fan axis at the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the top edge, the fan axis at the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_211]}, {212, "fan_cr", - "A fan unfolds from the right edge, the fan axis at the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the right edge, the fan axis at the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_212]}, {213, "doublefan_fov", - "Two fans, their axes at the center, unfold from the top and bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the center, unfold from the top and bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_213]}, {214, "doublefan_foh", - "Two fans, their axes at the center, unfold from the left and right", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the center, unfold from the left and right", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_214]}, {221, "singlesweep_cwt", - "A radial hand sweeps clockwise from the top edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the top edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_221]}, {222, "singlesweep_cwr", - "A radial hand sweeps clockwise from the right edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the right edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_222]}, {223, "singlesweep_cwb", - "A radial hand sweeps clockwise from the bottom edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the bottom edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_223]}, {224, "singlesweep_cwl", - "A radial hand sweeps clockwise from the left edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the left edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_224]}, {225, "doublesweep_pv", - "Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise and counter-clockwise from the top and bottom edges' midpoints", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_225]}, {226, "doublesweep_pd", - "Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands sweep clockwise and counter-clockwise from the left and right edges' midpoints", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_226]}, {227, "doublesweep_ov", - "Two radial hands attached at the top and bottom edges' midpoints sweep from right to left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the top and bottom edges' midpoints sweep from right to left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_227]}, {228, "doublesweep_oh", - "Two radial hands attached at the left and right edges' midpoints sweep from top to bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the left and right edges' midpoints sweep from top to bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_228]}, {231, "fan_t", - "A fan unfolds from the bottom, the fan axis at the top edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the bottom, the fan axis at the top edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_231]}, {232, "fan_r", - "A fan unfolds from the left, the fan axis at the right edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the left, the fan axis at the right edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_232]}, {233, "fan_b", - "A fan unfolds from the top, the fan axis at the bottom edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the top, the fan axis at the bottom edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_233]}, {234, "fan_l", - "A fan unfolds from the right, the fan axis at the left edge's midpoint", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A fan unfolds from the right, the fan axis at the left edge's midpoint", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_234]}, {235, "doublefan_fiv", - "Two fans, their axes at the top and bottom, unfold from the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the top and bottom, unfold from the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_235]}, {236, "doublefan_fih", - "Two fans, their axes at the left and right, unfold from the center", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two fans, their axes at the left and right, unfold from the center", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_236]}, {241, "singlesweep_cwtl", - "A radial hand sweeps clockwise from the upper-left corner", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the upper-left corner", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_241]}, {242, "singlesweep_cwbl", - "A radial hand sweeps counter-clockwise from the lower-left corner.", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps counter-clockwise from the lower-left corner.", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_242]}, {243, "singlesweep_cwbr", - "A radial hand sweeps clockwise from the lower-right corner", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps clockwise from the lower-right corner", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_243]}, {244, "singlesweep_cwtr", - "A radial hand sweeps counter-clockwise from the upper-right corner", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "A radial hand sweeps counter-clockwise from the upper-right corner", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_244]}, {245, "doublesweep_pdtl", - "Two radial hands attached at the upper-left and lower-right corners sweep down and up", - gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-left and lower-right corners sweep down and up", + gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_245]}, {246, "doublesweep_pdbl", - "Two radial hands attached at the lower-left and upper-right corners sweep down and up", - gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, + "Two radial hands attached at the lower-left and upper-right corners sweep down and up", + gst_wipe_triangles_clock_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_246]}, {251, "saloondoor_t", - "Two radial hands attached at the upper-left and upper-right corners sweep down", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-left and upper-right corners sweep down", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_251]}, {252, "saloondoor_l", - "Two radial hands attached at the upper-left and lower-left corners sweep to the right", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-left and lower-left corners sweep to the right", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_252]}, {253, "saloondoor_b", - "Two radial hands attached at the lower-left and lower-right corners sweep up", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the lower-left and lower-right corners sweep up", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_253]}, {254, "saloondoor_r", - "Two radial hands attached at the upper-right and lower-right corners sweep to the left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the upper-right and lower-right corners sweep to the left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_254]}, {261, "windshield_r", - "Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the midpoints of the top and bottom halves sweep from right to left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_261]}, {262, "windshield_u", - "Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two radial hands attached at the midpoints of the left and right halves sweep from top to bottom", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_262]}, {263, "windshield_v", - "Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two sets of radial hands attached at the midpoints of the top and bottom halves sweep from top to bottom and bottom to top", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_263]}, {264, "windshield_h", - "Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left", - gst_wipe_boxes_draw, _gst_mask_default_destroy, + "Two sets of radial hands attached at the midpoints of the left and right halves sweep from left to right and right to left", + gst_wipe_boxes_draw, _gst_mask_default_destroy, &wipe_config[WIPE_CONFIG_264]}, {0, NULL, NULL, NULL} }; diff --git a/gst/smpte/gstsmpte.c b/gst/smpte/gstsmpte.c index 91b91d9d..c948ad17 100644 --- a/gst/smpte/gstsmpte.c +++ b/gst/smpte/gstsmpte.c @@ -87,7 +87,7 @@ gst_smpte_transition_type_get_type (void) definitions = gst_mask_get_definitions (); smpte_transitions = - g_new0 (GEnumValue, g_list_length ((GList *) definitions) + 1); + g_new0 (GEnumValue, g_list_length ((GList *) definitions) + 1); while (definitions) { GstMaskDefinition *definition = (GstMaskDefinition *) definitions->data; @@ -102,7 +102,7 @@ gst_smpte_transition_type_get_type (void) } smpte_transition_type = - g_enum_register_static ("GstSMPTETransitionType", smpte_transitions); + g_enum_register_static ("GstSMPTETransitionType", smpte_transitions); } return smpte_transition_type; } @@ -140,8 +140,9 @@ gst_smpte_get_type (void) 0, (GInstanceInitFunc) gst_smpte_init, }; + smpte_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSMPTE", &smpte_info, 0); } return smpte_type; } @@ -178,18 +179,18 @@ gst_smpte_class_init (GstSMPTEClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TYPE, g_param_spec_enum ("type", "Type", "The type of transition to use", - GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE)); + GST_TYPE_SMPTE_TRANSITION_TYPE, 1, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_FPS, g_param_spec_float ("fps", "FPS", - "Frames per second if no input files are given", 0., G_MAXFLOAT, 25., - G_PARAM_READWRITE)); + "Frames per second if no input files are given", 0., G_MAXFLOAT, 25., + G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BORDER, g_param_spec_int ("border", "Border", - "The border width of the transition", 0, G_MAXINT, 0, - G_PARAM_READWRITE)); + "The border width of the transition", 0, G_MAXINT, 0, + G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DEPTH, g_param_spec_int ("depth", "Depth", "Depth of the mask in bits", 1, 24, - 16, G_PARAM_READWRITE)); + 16, G_PARAM_READWRITE)); } /* wht yel cya grn mag red blu blk -I Q */ @@ -324,8 +325,8 @@ gst_smpte_blend_i420 (guint8 * in1, guint8 * in2, guint8 * out, GstMask * mask, *out++ = ((*in1++ * value) + (*in2++ * (256 - value))) >> 8; if (!(i & 1) && !(j & 1)) { - *outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8; - *outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8; + *outu++ = ((*in1u++ * value) + (*in2u++ * (256 - value))) >> 8; + *outv++ = ((*in1v++ * value) + (*in2v++ * (256 - value))) >> 8; } } } @@ -376,25 +377,25 @@ gst_smpte_loop (GstElement * element) GstCaps *caps; caps = - gst_caps_copy (gst_static_caps_get (&gst_smpte_src_template. - static_caps)); + gst_caps_copy (gst_static_caps_get (&gst_smpte_src_template. + static_caps)); gst_caps_set_simple (caps, "width", G_TYPE_INT, smpte->width, "height", - G_TYPE_INT, smpte->height, "framerate", G_TYPE_DOUBLE, smpte->fps, - NULL); + G_TYPE_INT, smpte->height, "framerate", G_TYPE_DOUBLE, smpte->fps, + NULL); if (!gst_pad_try_set_caps (smpte->srcpad, caps)) { - GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL), (NULL)); - return; + GST_ELEMENT_ERROR (smpte, CORE, NEGOTIATION, (NULL), (NULL)); + return; } } gst_smpte_blend_i420 (GST_BUFFER_DATA (in1), - GST_BUFFER_DATA (in2), - GST_BUFFER_DATA (outbuf), - smpte->mask, smpte->width, smpte->height, - smpte->border, - ((1 << smpte->depth) + smpte->border) * - smpte->position / smpte->duration); + GST_BUFFER_DATA (in2), + GST_BUFFER_DATA (outbuf), + smpte->mask, smpte->width, smpte->height, + smpte->border, + ((1 << smpte->depth) + smpte->border) * + smpte->position / smpte->duration); } else { outbuf = in2; gst_buffer_ref (in2); @@ -425,7 +426,7 @@ gst_smpte_set_property (GObject * object, guint prop_id, gint type = g_value_get_enum (value); gst_smpte_update_mask (smpte, type, smpte->depth, - smpte->width, smpte->height); + smpte->width, smpte->height); break; } case ARG_BORDER: @@ -439,7 +440,7 @@ gst_smpte_set_property (GObject * object, guint prop_id, gint depth = g_value_get_int (value); gst_smpte_update_mask (smpte, smpte->type, depth, - smpte->width, smpte->height); + smpte->width, smpte->height); break; } default: @@ -459,7 +460,7 @@ gst_smpte_get_property (GObject * object, guint prop_id, switch (prop_id) { case ARG_TYPE: if (smpte->mask) { - g_value_set_enum (value, smpte->mask->type); + g_value_set_enum (value, smpte->mask->type); } break; case ARG_FPS: diff --git a/gst/smpte/paint.c b/gst/smpte/paint.c index fdff77e5..f4f64829 100644 --- a/gst/smpte/paint.c +++ b/gst/smpte/paint.c @@ -189,22 +189,22 @@ gst_smpte_paint_triangle_linear (guint32 * dest, gint stride, e += sign; for (j = s; j != e; j += sign) { - dest[j] = (ec * (j - s) + sc * (e - j)) / (e - s); + dest[j] = (ec * (j - s) + sc * (e - j)) / (e - s); } while (pyr == i) { - STEP_3D_LINE (dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, - xrr, yrr, crr, pxr, pyr, pcr); + STEP_3D_LINE (dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, + xrr, yrr, crr, pxr, pyr, pcr); } while (pyl == i) { - STEP_3D_LINE (dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, - xrl, yrl, crl, pxl, pyl, pcl); + STEP_3D_LINE (dxlabs, dylabs, dclabs, sdxl, sdyl, sdcl, + xrl, yrl, crl, pxl, pyl, pcl); } dest += stride; } PREPARE_3D_LINE (x1, y1, c1, x2, y2, c2, - dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr); + dxrabs, dyrabs, dcrabs, sdxr, sdyr, sdcr, xrr, yrr, crr, pxr, pyr, pcr); seg_start = y1; seg_end = y2; @@ -265,7 +265,7 @@ gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, angle_s = 0.0; angle_e = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (y2 - y0)) / (sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) * - sqrt ((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0)))); + sqrt ((x2 - x0) * (x2 - x0) + (y2 - y0) * (y2 - y0)))); len1 = sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)); @@ -274,28 +274,28 @@ gst_smpte_paint_triangle_clock (guint32 * dest, gint stride, for (i = y1; i != (y2 + sign); i += sign) { if (y1 == i) - angle = 0; + angle = 0; else - angle = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (i - y0)) / - (len1 * sqrt ((x1 - x0) * (x1 - x0) + (i - y0) * (i - - y0)))) / angle_e; + angle = acos (((x1 - x0) * (x2 - x0) + (y1 - y0) * (i - y0)) / + (len1 * sqrt ((x1 - x0) * (x1 - x0) + (i - y0) * (i - + y0)))) / angle_e; draw_bresenham_line (dest, stride, - x0, y0, x1, i, (c2 * angle + c1 * (1.0 - angle))); + x0, y0, x1, i, (c2 * angle + c1 * (1.0 - angle))); } } else if (y1 == y2) { sign = SIGN (x2 - x1); for (i = x1; i != (x2 + sign); i += sign) { if (x1 == i) - angle = 0; + angle = 0; else - angle = acos (((x1 - x0) * (i - x0) + (y1 - y0) * (y2 - y0)) / - (len1 * sqrt ((i - x0) * (i - x0) + (y2 - y0) * (y2 - - y0)))) / angle_e; + angle = acos (((x1 - x0) * (i - x0) + (y1 - y0) * (y2 - y0)) / + (len1 * sqrt ((i - x0) * (i - x0) + (y2 - y0) * (y2 - + y0)))) / angle_e; draw_bresenham_line (dest, stride, - x0, y0, i, y1, (c2 * angle + c1 * (1.0 - angle))); + x0, y0, i, y1, (c2 * angle + c1 * (1.0 - angle))); } } } @@ -321,7 +321,7 @@ gst_smpte_paint_box_clock (guint32 * dest, gint stride, angle_m = 2 * acos (((x1 - x0) * (xv - x0) + (y1 - y0) * (yv - y0)) / (sqrt ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) * - sqrt ((xv - x0) * (xv - x0) + (yv - y0) * (yv - y0)))) / M_PI; + sqrt ((xv - x0) * (xv - x0) + (yv - y0) * (yv - y0)))) / M_PI; col_m = c2 * angle_m + c1 * (1.0 - angle_m); diff --git a/gst/spectrum/demo-osssrc.c b/gst/spectrum/demo-osssrc.c index 462fcf90..1bd2fa11 100644 --- a/gst/spectrum/demo-osssrc.c +++ b/gst/spectrum/demo-osssrc.c @@ -75,7 +75,7 @@ spectrum_chain (GstPad * pad, GstData * _data) TRUE, 0, 0, GST_BUFFER_SIZE (buf), 25); for (i = 0; i < GST_BUFFER_SIZE (buf); i++) { gdk_draw_rectangle (drawingarea->window, drawingarea->style->white_gc, - TRUE, i, 32 - data[i], 1, data[i]); + TRUE, i, 32 - data[i], 1, data[i]); } gst_buffer_unref (buf); } diff --git a/gst/spectrum/fix_fft.c b/gst/spectrum/fix_fft.c index db6c3a82..d5aed1f1 100644 --- a/gst/spectrum/fix_fft.c +++ b/gst/spectrum/fix_fft.c @@ -61,11 +61,11 @@ #define FIX_MPY(DEST,A,B) DEST = ((long)(A) * (long)(B))>>15 -#define N_WAVE 1024 /* dimension of Sinewave[] */ -#define LOG2_N_WAVE 10 /* log2(N_WAVE) */ -#define N_LOUD 100 /* dimension of Loudampl[] */ +#define N_WAVE 1024 /* dimension of Sinewave[] */ +#define LOG2_N_WAVE 10 /* log2(N_WAVE) */ +#define N_LOUD 100 /* dimension of Loudampl[] */ -extern fixed gst_spectrum_Sinewave[N_WAVE]; /* placed at end of this file for clarity */ +extern fixed gst_spectrum_Sinewave[N_WAVE]; /* placed at end of this file for clarity */ extern fixed gst_spectrum_Loudampl[N_LOUD]; static int gst_spectrum_db_from_ampl (fixed re, fixed im); static fixed gst_spectrum_fix_mpy (fixed a, fixed b); @@ -119,19 +119,19 @@ gst_spectrum_fix_fft (fixed fr[], fixed fi[], int m, int inverse) /* variable scaling, depending upon data */ shift = 0; for (i = 0; i < n; ++i) { - j = fr[i]; - if (j < 0) - j = -j; - m = fi[i]; - if (m < 0) - m = -m; - if (j > 16383 || m > 16383) { - shift = 1; - break; - } + j = fr[i]; + if (j < 0) + j = -j; + m = fi[i]; + if (m < 0) + m = -m; + if (j > 16383 || m > 16383) { + shift = 1; + break; + } } if (shift) - ++scale; + ++scale; } else { /* fixed scaling, for proper normalization - there will be log2(n) passes, so this @@ -148,27 +148,27 @@ gst_spectrum_fix_fft (fixed fr[], fixed fi[], int m, int inverse) wr = gst_spectrum_Sinewave[j + N_WAVE / 4]; wi = -gst_spectrum_Sinewave[j]; if (inverse) - wi = -wi; + wi = -wi; if (shift) { - wr >>= 1; - wi >>= 1; + wr >>= 1; + wi >>= 1; } for (i = m; i < n; i += istep) { - j = i + l; - tr = gst_spectrum_fix_mpy (wr, fr[j]) - - gst_spectrum_fix_mpy (wi, fi[j]); - ti = gst_spectrum_fix_mpy (wr, fi[j]) + - gst_spectrum_fix_mpy (wi, fr[j]); - qr = fr[i]; - qi = fi[i]; - if (shift) { - qr >>= 1; - qi >>= 1; - } - fr[j] = qr - tr; - fi[j] = qi - ti; - fr[i] = qr + tr; - fi[i] = qi + ti; + j = i + l; + tr = gst_spectrum_fix_mpy (wr, fr[j]) - + gst_spectrum_fix_mpy (wi, fi[j]); + ti = gst_spectrum_fix_mpy (wr, fi[j]) + + gst_spectrum_fix_mpy (wi, fr[j]); + qr = fr[i]; + qi = fi[i]; + if (shift) { + qr >>= 1; + qi >>= 1; + } + fr[j] = qr - tr; + fi[j] = qi - ti; + fr[i] = qr + tr; + fi[i] = qi + ti; } } --k; @@ -230,7 +230,7 @@ gst_spectrum_db_from_ampl (fixed re, fixed im) if (loud2[0] == 0) { loud2[0] = - (long) gst_spectrum_Loudampl[0] * (long) gst_spectrum_Loudampl[0]; + (long) gst_spectrum_Loudampl[0] * (long) gst_spectrum_Loudampl[0]; for (i = 1; i < N_LOUD; ++i) { v = (long) gst_spectrum_Loudampl[i] * (long) gst_spectrum_Loudampl[i]; loud2[i] = v; @@ -272,7 +272,7 @@ gst_spectrum_iscale (int value, int numer, int denom) fixed gst_spectrum_fix_dot (fixed * hpa, fixed * pb, int n) { - fixed *pa = hpa; /* FIXME */ + fixed *pa = hpa; /* FIXME */ long sum; register fixed a, b; diff --git a/gst/spectrum/gstspectrum.c b/gst/spectrum/gstspectrum.c index aa309f1c..b87763cb 100644 --- a/gst/spectrum/gstspectrum.c +++ b/gst/spectrum/gstspectrum.c @@ -82,9 +82,10 @@ gst_spectrum_get_type (void) 0, (GInstanceInitFunc) gst_spectrum_init, }; + spectrum_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSpectrum", &spectrum_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSpectrum", &spectrum_info, + 0); } return spectrum_type; } @@ -105,7 +106,7 @@ gst_spectrum_class_init (GstSpectrumClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_WRITABLE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_WIDTH, g_param_spec_int ("width", "width", "width", G_MININT, G_MAXINT, 0, G_PARAM_WRITABLE)); /* CHECKME */ gobject_class->set_property = gst_spectrum_set_property; } diff --git a/gst/speed/demo-mp3.c b/gst/speed/demo-mp3.c index 5b83347a..f9a169ae 100644 --- a/gst/speed/demo-mp3.c +++ b/gst/speed/demo-mp3.c @@ -49,7 +49,7 @@ main (int argc, char **argv) vbox = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox); hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (1.0, 0.01, 4.0, - 0.1, 0.0, 0.0))); + 0.1, 0.0, 0.0))); gtk_scale_set_digits (GTK_SCALE (hscale), 2); gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_CONTINUOUS); button = gtk_button_new_with_label ("quit"); @@ -68,7 +68,7 @@ main (int argc, char **argv) g_object_set (osssink, "fragment", 0x00180008, NULL); gtk_signal_connect (GTK_OBJECT (gtk_range_get_adjustment (GTK_RANGE - (hscale))), "value_changed", G_CALLBACK (set_speed), speed); + (hscale))), "value_changed", G_CALLBACK (set_speed), speed); pipeline = gst_pipeline_new ("app"); gst_bin_add_many (GST_BIN (pipeline), filesrc, mad, stereo2mono, speed, diff --git a/gst/speed/gstspeed.c b/gst/speed/gstspeed.c index 12752f12..090d13d0 100644 --- a/gst/speed/gstspeed.c +++ b/gst/speed/gstspeed.c @@ -60,7 +60,7 @@ static GstStaticPadTemplate gst_speed_sink_template = GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static GstStaticPadTemplate gst_speed_src_template = @@ -68,7 +68,7 @@ static GstStaticPadTemplate gst_speed_src_template = GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_AUDIO_INT_PAD_TEMPLATE_CAPS "; " - GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) + GST_AUDIO_FLOAT_STANDARD_PAD_TEMPLATE_CAPS) ); static void speed_base_init (gpointer g_class); @@ -157,8 +157,9 @@ gst_speed_get_type (void) 0, (GInstanceInitFunc) speed_init, }; + speed_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstSpeed", &speed_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstSpeed", &speed_info, 0); } return speed_type; } @@ -187,7 +188,7 @@ speed_class_init (GstSpeedClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_SPEED, g_param_spec_float ("speed", "speed", "speed", - 0.1, 40.0, 1.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); + 0.1, 40.0, 1.0, G_PARAM_READWRITE | G_PARAM_CONSTRUCT)); } static void @@ -250,7 +251,7 @@ speed_loop (GstElement * element) #undef _FORMAT } else { GST_ELEMENT_ERROR (filter, CORE, NEGOTIATION, (NULL), - ("format wasn't negotiated before chain function")); + ("format wasn't negotiated before chain function")); gst_element_yield (element); } } diff --git a/gst/stereo/gststereo.c b/gst/stereo/gststereo.c index 947c3885..a0fb74a3 100644 --- a/gst/stereo/gststereo.c +++ b/gst/stereo/gststereo.c @@ -81,8 +81,9 @@ gst_stereo_get_type (void) 0, (GInstanceInitFunc) gst_stereo_init, }; + stereo_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstStereo", &stereo_info, 0); } return stereo_type; } @@ -105,8 +106,8 @@ gst_stereo_class_init (GstStereoClass * klass) parent_class = g_type_class_ref (GST_TYPE_ELEMENT); - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ - g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_ACTIVE, g_param_spec_int ("active", "active", "active", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); /* CHECKME */ + g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STEREO, g_param_spec_float ("stereo", "stereo", "stereo", 0.0, 1.0, 0.0, G_PARAM_READWRITE)); /* CHECKME */ gobject_class->set_property = gst_stereo_set_property; gobject_class->get_property = gst_stereo_get_property; @@ -160,16 +161,16 @@ gst_stereo_chain (GstPad * pad, GstData * _data) tmp = avg + ldiff * mul; if (tmp < -32768) - tmp = -32768; + tmp = -32768; if (tmp > 32767) - tmp = 32767; + tmp = 32767; data[i] = tmp; tmp = avg + rdiff * mul; if (tmp < -32768) - tmp = -32768; + tmp = -32768; if (tmp > 32767) - tmp = 32767; + tmp = 32767; data[i + 1] = tmp; } /*} */ diff --git a/gst/switch/gstswitch.c b/gst/switch/gstswitch.c index 995bbdbe..d0cb2cc5 100644 --- a/gst/switch/gstswitch.c +++ b/gst/switch/gstswitch.c @@ -115,7 +115,7 @@ gst_switch_request_new_pad (GstElement * element, /* We only provide requested sink pads */ if (templ->direction != GST_PAD_SINK) { GST_CAT_LOG_OBJECT (GST_CAT_ELEMENT_PADS, gstswitch, - "requested a non sink pad"); + "requested a non sink pad"); return NULL; } @@ -171,41 +171,41 @@ gst_switch_poll_sinkpads (GstSwitch * gstswitch) if (GST_PAD_IS_USABLE (switchpad->sinkpad) && !switchpad->eos) { GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "polling pad %p", switchpad->sinkpad); + "polling pad %p", switchpad->sinkpad); /* We loose the reference to the data we stored */ if (switchpad->data) { - gst_data_unref (switchpad->data); + gst_data_unref (switchpad->data); } /* If that data was not forwarded we unref it another time to destroy it */ if (!switchpad->forwarded && switchpad->data) { - gst_data_unref (switchpad->data); + gst_data_unref (switchpad->data); } switchpad->data = NULL; switchpad->data = gst_pad_pull (switchpad->sinkpad); if (!switchpad->data) { - GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "received NULL data from pad %p", switchpad->sinkpad); + GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, + "received NULL data from pad %p", switchpad->sinkpad); } else { - gst_data_ref (switchpad->data); - switchpad->forwarded = FALSE; - - /* If the buffer is an EOS event we tag the pad as being in EOS. That - means we won't try to pull more data from that pad */ - if (GST_IS_EVENT (switchpad->data) && - (GST_EVENT_TYPE (GST_EVENT (switchpad->data)) == GST_EVENT_EOS)) { - GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "received EOS event on pad %p", switchpad->sinkpad); - switchpad->eos = TRUE; - } + gst_data_ref (switchpad->data); + switchpad->forwarded = FALSE; + + /* If the buffer is an EOS event we tag the pad as being in EOS. That + means we won't try to pull more data from that pad */ + if (GST_IS_EVENT (switchpad->data) && + (GST_EVENT_TYPE (GST_EVENT (switchpad->data)) == GST_EVENT_EOS)) { + GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, + "received EOS event on pad %p", switchpad->sinkpad); + switchpad->eos = TRUE; + } } } else { GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "not pulling from pad %s (eos is %d)", - gst_pad_get_name (switchpad->sinkpad), switchpad->eos); + "not pulling from pad %s (eos is %d)", + gst_pad_get_name (switchpad->sinkpad), switchpad->eos); } pads = g_list_next (pads); } @@ -238,20 +238,20 @@ gst_switch_loop (GstElement * element) switchpad->data = NULL; GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "using data from active pad %p", switchpad->sinkpad); + "using data from active pad %p", switchpad->sinkpad); if (GST_IS_EVENT (data)) { GstEvent *event = GST_EVENT (data); GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "handling event from active pad %p", switchpad->sinkpad); + "handling event from active pad %p", switchpad->sinkpad); /* Handling event */ gst_pad_event_default (switchpad->sinkpad, event); } else { /* Pushing active sinkpad data to srcpad */ GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, gstswitch, - "pushing data from active pad %p to %p", - switchpad->sinkpad, gstswitch->srcpad); + "pushing data from active pad %p to %p", + switchpad->sinkpad, gstswitch->srcpad); gst_pad_push (gstswitch->srcpad, data); } @@ -281,18 +281,18 @@ gst_switch_change_state (GstElement * element) sinkpads = gstswitch->sinkpads; while (sinkpads) { - GstSwitchPad *switchpad = sinkpads->data; + GstSwitchPad *switchpad = sinkpads->data; - /* If a data is still stored in our structure we unref it */ - if (switchpad->data) { - gst_data_unref (switchpad->data); - switchpad->data = NULL; - } + /* If a data is still stored in our structure we unref it */ + if (switchpad->data) { + gst_data_unref (switchpad->data); + switchpad->data = NULL; + } - switchpad->forwarded = FALSE; - switchpad->eos = FALSE; + switchpad->forwarded = FALSE; + switchpad->eos = FALSE; - sinkpads = g_list_next (sinkpads); + sinkpads = g_list_next (sinkpads); } } break; @@ -438,13 +438,13 @@ gst_switch_class_init (GstSwitchClass * klass) g_object_class_install_property (gobject_class, ARG_NB_SOURCES, g_param_spec_int ("nb_sources", - "number of sources", - "number of sources", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); + "number of sources", + "number of sources", G_MININT, G_MAXINT, 0, G_PARAM_READABLE)); g_object_class_install_property (gobject_class, ARG_ACTIVE_SOURCE, g_param_spec_int ("active_source", - "active source", - "active source", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); + "active source", + "active source", G_MININT, G_MAXINT, 0, G_PARAM_READWRITE)); gobject_class->dispose = gst_switch_dispose; gobject_class->set_property = gst_switch_set_property; @@ -480,7 +480,7 @@ gst_switch_get_type (void) }; switch_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstSwitch", &switch_info, 0); + "GstSwitch", &switch_info, 0); } return switch_type; diff --git a/gst/vbidec/gstvbidec.c b/gst/vbidec/gstvbidec.c index 2a92b297..749cf65d 100644 --- a/gst/vbidec/gstvbidec.c +++ b/gst/vbidec/gstvbidec.c @@ -115,10 +115,11 @@ gst_vbidec_caption_type_get_type (void) {CAPTURE_T4, "9", "Closed Caption T4"}, {0, NULL, NULL}, }; + if (!vbidec_caption_type_type) { vbidec_caption_type_type = - g_enum_register_static ("GstVBIDecCaptionTypeType", - vbidec_caption_type); + g_enum_register_static ("GstVBIDecCaptionTypeType", + vbidec_caption_type); } return vbidec_caption_type_type; } @@ -155,8 +156,9 @@ gst_vbidec_get_type (void) 0, (GInstanceInitFunc) gst_vbidec_init, }; + vbidec_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstVBIDec", &vbidec_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstVBIDec", &vbidec_info, 0); } return vbidec_type; } @@ -189,14 +191,14 @@ gst_vbidec_class_init (GstVBIDecClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_VERBOSE, g_param_spec_boolean ("verbose", "verbose", "verbose", - FALSE, G_PARAM_WRITABLE)); + FALSE, G_PARAM_WRITABLE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_CAPTION_TYPE, g_param_spec_enum ("caption type", "caption type", "Closed Caption Type", - GST_TYPE_VBIDEC_CAPTION_TYPE_TYPE, CAPTURE_OFF, G_PARAM_READWRITE)); + GST_TYPE_VBIDEC_CAPTION_TYPE_TYPE, CAPTURE_OFF, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_DVD_INPUT, g_param_spec_boolean ("dvd input", "dvd input", - "VBI is encapsulated in MPEG2 GOP user_data field (as on DVDs)", - FALSE, G_PARAM_READWRITE)); + "VBI is encapsulated in MPEG2 GOP user_data field (as on DVDs)", + FALSE, G_PARAM_READWRITE)); } static void @@ -233,7 +235,7 @@ dvd_user_data_decode (GstVBIDec * vbidec, guint8 * data, guint32 size) { //char caption[128]; //int ci; /* caption index */ - int i; /* buf index */ + int i; /* buf index */ int num_disp_field; guint8 b1, b2; int w; @@ -248,8 +250,8 @@ dvd_user_data_decode (GstVBIDec * vbidec, guint8 * data, guint32 size) return; } //g_print ("CC data\n"); - i += 4; /* above */ - i += 4; /* ? */ + i += 4; /* above */ + i += 4; /* ? */ num_disp_field = data[i] & 0x3f; //g_print ("ndf %d\n", num_disp_field); while ((data[i] & 0xfe) == 0xfe) { diff --git a/gst/vbidec/vbidata.c b/gst/vbidec/vbidata.c index 75a85e48..76f43110 100644 --- a/gst/vbidec/vbidata.c +++ b/gst/vbidec/vbidata.c @@ -115,7 +115,7 @@ static char *extcode2 = "\0303\0343\0315\0314\0354\0322\0362\0325" int parityok (int n) -{ /* check parity for 2 bytes packed in n */ +{ /* check parity for 2 bytes packed in n */ int j, k; for (k = 0, j = 0; j < 7; j++) @@ -135,11 +135,11 @@ int decodebit (unsigned char *data, int threshold) { return ((data[0] + data[1] + data[2] + data[3] + data[4] + data[5] + - data[6] + data[7] + data[8] + data[9] + data[10] + data[11] + - data[12] + data[13] + data[14] + data[15] + data[16] + data[17] + - data[18] + data[19] + data[20] + data[21] + data[22] + data[23] + - data[24] + data[25] + data[26] + data[27] + data[28] + data[29] + - data[30] + data[31]) >> 5 > threshold); + data[6] + data[7] + data[8] + data[9] + data[10] + data[11] + + data[12] + data[13] + data[14] + data[15] + data[16] + data[17] + + data[18] + data[19] + data[20] + data[21] + data[22] + data[23] + + data[24] + data[25] + data[26] + data[27] + data[28] + data[29] + + data[30] + data[31]) >> 5 > threshold); } @@ -170,7 +170,7 @@ ccdecode (unsigned char *vbiline) if (!decodebit (&vbiline[i], sample)) return 0; #ifndef PAL_DECODE - tmp = i + 57; /* tmp = data bit zero */ + tmp = i + 57; /* tmp = data bit zero */ #else tmp = i + 71; #endif @@ -187,7 +187,7 @@ ccdecode (unsigned char *vbiline) if (parityok (packedbits)) return packedbits; return 0; -} /* ccdecode */ +} /* ccdecode */ const char *movies[] = { "N/A", "G", "PG", "PG-13", "R", "NC-17", "X", "Not Rated" @@ -280,25 +280,25 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) const char *str; switch (VSL | scheme) { - case 3: /* Canadian English TV */ - str = cane_tv[tv_rating]; - break; - case 7: /* Canadian French TV */ - str = canf_tv[tv_rating]; - break; - case 19: /* Reserved */ + case 3: /* Canadian English TV */ + str = cane_tv[tv_rating]; + break; + case 7: /* Canadian French TV */ + str = canf_tv[tv_rating]; + break; + case 19: /* Reserved */ case 31: - str = ""; - break; + str = ""; + break; default: - if (((VSL | scheme) & 3) == 1) { - /* USA TV */ - str = usa_tv[tv_rating]; - } else { - /* MPAA Movie Rating */ - str = movies[movie_rating]; - } - break; + if (((VSL | scheme) & 3) == 1) { + /* USA TV */ + str = usa_tv[tv_rating]; + } else { + /* MPAA Movie Rating */ + str = movies[movie_rating]; + } + break; } if (vbi->rating && !strcmp (vbi->rating, str)) { @@ -310,20 +310,20 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) if (((VSL | scheme) & 3) == 1 || ((VSL | scheme) & 3) == 0) { /* show VSLD for the americans */ if ((VSL | scheme) & 32) { - if (vbi->verbose) - fprintf (stderr, " V"); + if (vbi->verbose) + fprintf (stderr, " V"); } if ((VSL | scheme) & 16) { - if (vbi->verbose) - fprintf (stderr, " S"); + if (vbi->verbose) + fprintf (stderr, " S"); } if ((VSL | scheme) & 8) { - if (vbi->verbose) - fprintf (stderr, " L"); + if (vbi->verbose) + fprintf (stderr, " L"); } if ((VSL | scheme) & 4) { - if (vbi->verbose) - fprintf (stderr, " D"); + if (vbi->verbose) + fprintf (stderr, " D"); } } if (vbi->verbose) @@ -342,15 +342,15 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) vbi->call_letters = strdup (packet + 2); /*tvtime_osd_set_network_call( vbi->osd, vbi->call_letters ); */ } else if (packet[0] == 0x01 && packet[1] == 0x01) { - int month = packet[5]; // & 15; - int day = packet[4]; // & 31; - int hour = packet[3]; // & 31; - int min = packet[2]; // & 63; + int month = packet[5]; // & 15; + int day = packet[4]; // & 31; + int hour = packet[3]; // & 31; + int min = packet[2]; // & 63; char str[33]; if (vbi->verbose) fprintf (stderr, "Program Start: %02d %s, %02d:%02d\n", - day & 31, months[month & 15], hour & 31, min & 63); + day & 31, months[month & 15], hour & 31, min & 63); // packet[ 3 ], packet[ 4 ], packet[ 5 ], packet[ 6 ] ); //packet[ 5 ] & 31, packet[ 6 ], packet[ 4 ] & 31, packet[ 3 ] & 63 ); vbi->start_month = month & 15; @@ -358,7 +358,7 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) vbi->start_hour = hour & 31; vbi->start_min = hour & 63; snprintf (str, 32, "%02d %s, %02d:%02d", - day & 31, months[month & 15], hour & 31, min & 63); + day & 31, months[month & 15], hour & 31, min & 63); /*tvtime_osd_set_show_start( vbi->osd, str ); */ } else if (packet[0] == 0x01 && packet[1] == 0x04) { if (vbi->verbose) @@ -367,10 +367,10 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) int cur = packet[2 + i] - 0x20; if (cur >= 0 && cur < 96) { - if (vbi->verbose) - fprintf (stderr, "%s%s", i ? ", " : "", eia608_program_type[cur]); - /* this will cause us to keep only the last type we check */ - vbi->program_type = eia608_program_type[cur]; + if (vbi->verbose) + fprintf (stderr, "%s%s", i ? ", " : "", eia608_program_type[cur]); + /* this will cause us to keep only the last type we check */ + vbi->program_type = eia608_program_type[cur]; } } if (vbi->verbose) @@ -378,7 +378,7 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) } else if (packet[0] < 0x03 && packet[1] >= 0x10 && packet[1] <= 0x17) { if (vbi->program_desc[packet[1] & 0xf] && - !strcmp (vbi->program_desc[packet[1] & 0xf], packet + 2)) { + !strcmp (vbi->program_desc[packet[1] & 0xf], packet + 2)) { return; } @@ -395,17 +395,17 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) str[0] = 0; if (vbi->verbose) fprintf (stderr, "Program Length: %02d:%02d", - packet[3] & 63, packet[2] & 63); + packet[3] & 63, packet[2] & 63); vbi->length_hour = packet[3] & 63; vbi->length_min = packet[2] & 63; snprintf (str, 32, "%02d:%02d", packet[3] & 63, packet[2] & 63); if (length > 4) { if (vbi->verbose) - fprintf (stderr, " Elapsed: %02d:%02d", packet[5] & 63, packet[4] & 63); + fprintf (stderr, " Elapsed: %02d:%02d", packet[5] & 63, packet[4] & 63); vbi->length_elapsed_hour = packet[5] & 63; vbi->length_elapsed_min = packet[4] & 63; snprintf (str, 32, "%02d:%02d/%02d:%02d", - packet[5] & 63, packet[4] & 63, packet[3] & 63, packet[2] & 63); + packet[5] & 63, packet[4] & 63, packet[3] & 63, packet[2] & 63); } else { vbi->length_elapsed_hour = 0; vbi->length_elapsed_min = 0; @@ -413,11 +413,11 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) if (length > 6) { if (vbi->verbose) - fprintf (stderr, ".%02d", packet[6] & 63); + fprintf (stderr, ".%02d", packet[6] & 63); vbi->length_elapsed_hour = packet[6] & 63; snprintf (str, 32, "%02d:%02d.%02d/%02d:%02d", - packet[5] & 63, packet[4] & 63, packet[6] & 63, - packet[3] & 63, packet[2] & 63); + packet[5] & 63, packet[4] & 63, packet[6] & 63, + packet[3] & 63, packet[2] & 63); } else { vbi->length_elapsed_hour = 0; } @@ -427,7 +427,7 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) } else if (packet[0] == 0x05 && packet[1] == 0x04) { if (vbi->verbose) fprintf (stderr, "Transmission Signal Identifier (TSID): 0x%04x\n", - packet[2] << 24 | packet[3] << 16 | packet[4] << 8 | packet[5]); + packet[2] << 24 | packet[3] << 16 | packet[4] << 8 | packet[5]); } else { /* unknown */ @@ -435,71 +435,71 @@ parse_xds_packet (vbidata_t * vbi, char *packet, int length) fprintf (stderr, "Unknown XDS packet, class "); switch (packet[0]) { case 0x1: - if (vbi->verbose) - fprintf (stderr, "CURRENT start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CURRENT start\n"); + break; case 0x2: - if (vbi->verbose) - fprintf (stderr, "CURRENT continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CURRENT continue\n"); + break; case 0x3: - if (vbi->verbose) - fprintf (stderr, "FUTURE start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "FUTURE start\n"); + break; case 0x4: - if (vbi->verbose) - fprintf (stderr, "FUTURE continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "FUTURE continue\n"); + break; case 0x5: - if (vbi->verbose) - fprintf (stderr, "CHANNEL start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CHANNEL start\n"); + break; case 0x6: - if (vbi->verbose) - fprintf (stderr, "CHANNEL continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "CHANNEL continue\n"); + break; case 0x7: - if (vbi->verbose) - fprintf (stderr, "MISC start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "MISC start\n"); + break; case 0x8: - if (vbi->verbose) - fprintf (stderr, "MISC continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "MISC continue\n"); + break; case 0x9: - if (vbi->verbose) - fprintf (stderr, "PUB start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "PUB start\n"); + break; case 0xa: - if (vbi->verbose) - fprintf (stderr, "PUB continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "PUB continue\n"); + break; case 0xb: - if (vbi->verbose) - fprintf (stderr, "RES start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "RES start\n"); + break; case 0xc: - if (vbi->verbose) - fprintf (stderr, "RES continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "RES continue\n"); + break; case 0xd: - if (vbi->verbose) - fprintf (stderr, "UNDEF start\n"); - break; + if (vbi->verbose) + fprintf (stderr, "UNDEF start\n"); + break; case 0xe: - if (vbi->verbose) - fprintf (stderr, "UNDEF continue\n"); - break; + if (vbi->verbose) + fprintf (stderr, "UNDEF continue\n"); + break; } for (i = 0; i < length; i++) { if (vbi->verbose) - fprintf (stderr, "0x%02x ", packet[i]); + fprintf (stderr, "0x%02x ", packet[i]); } if (vbi->verbose) fprintf (stderr, "\n"); @@ -554,18 +554,18 @@ xds_decode (vbidata_t * vbi, int b1, int b2) #define T4 4 const unsigned int colours[] = { - 0xFFFFFFFFU, /* white */ - 0xFF00FF00U, /* green */ - 0xFF0000FFU, /* blue */ - 0xFF00C7C7U, /* cyan */ - 0xFFFF0000U, /* red */ - 0xFFFFFF00U, /* yellow */ - 0xFFC700C7U /* magenta */ + 0xFFFFFFFFU, /* white */ + 0xFF00FF00U, /* green */ + 0xFF0000FFU, /* blue */ + 0xFF00C7C7U, /* cyan */ + 0xFFFF0000U, /* red */ + 0xFFFFFF00U, /* yellow */ + 0xFFC700C7U /* magenta */ }; const int rows[] = { 11, - 0, /* unused */ + 0, /* unused */ 1, 2, 3, @@ -609,46 +609,46 @@ Process16b (vbidata_t * vbi, int bottom, int w1) /* This sets up colors and indenting */ if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; } vbi->current_chan = (b1 & 8) >> 3; if (!bottom == vbi->wanttop) { - if (vbi->chan != vbi->current_chan) - return 0; + if (vbi->chan != vbi->current_chan) + return 0; } else - return 0; + return 0; vbi->current_ital = (b2 & 1); if (!(b2 & 16)) { - vbi->current_colour = colours[(b2 & 30) >> 1]; - vbi->current_indent = 0; + vbi->current_colour = colours[(b2 & 30) >> 1]; + vbi->current_indent = 0; } else { - vbi->current_colour = 0xFFFFFFFFU; /* white */ - vbi->current_indent = 4 * ((b2 & 14) >> 1); + vbi->current_colour = 0xFFFFFFFFU; /* white */ + vbi->current_indent = 4 * ((b2 & 14) >> 1); } vbi->current_row = rows[((b1 & 7) << 1) | ((b2 & 32) >> 5)]; vbi->current_ul = b2 & 1; if (vbi->verbose) - fprintf (stderr, "field: %d chan %d, ital %d, ul %d, colour 0x%x, " - "indent %d, row %d\n", bottom, vbi->current_chan, - vbi->current_ital, vbi->current_ul, vbi->current_colour, - vbi->current_indent, vbi->current_row); + fprintf (stderr, "field: %d chan %d, ital %d, ul %d, colour 0x%x, " + "indent %d, row %d\n", bottom, vbi->current_chan, + vbi->current_ital, vbi->current_ul, vbi->current_colour, + vbi->current_indent, vbi->current_row); if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; - vbiscreen_new_caption (vbi->vs, vbi->indent, vbi->ital, - vbi->colour, vbi->row); + vbiscreen_new_caption (vbi->vs, vbi->indent, vbi->ital, + vbi->colour, vbi->row); } @@ -660,15 +660,15 @@ Process16b (vbidata_t * vbi, int bottom, int w1) if ((b1 & 8) == 1) { /* Midrow code */ if (!vbi->initialised) - return 0; + return 0; if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; } if (vbi->verbose) - fprintf (stderr, "Midrow TODO: Add me.\n"); + fprintf (stderr, "Midrow TODO: Add me.\n"); vbi->lastcode = (b1 << 8) | b2; return 1; @@ -676,229 +676,229 @@ Process16b (vbidata_t * vbi, int bottom, int w1) if ((b1 & 2) && !(b2 & 64)) { if (!vbi->initialised) - return 0; + return 0; if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; } if (vbi->verbose) - fprintf (stderr, "Tab Offset: %d columns\n", b2 & 3); + fprintf (stderr, "Tab Offset: %d columns\n", b2 & 3); if (vbi->wanttext && vbi->current_istext && - vbi->current_chan == vbi->chan && !bottom == vbi->wanttop) { - vbiscreen_tab (vbi->vs, b2 & 3); + vbi->current_chan == vbi->chan && !bottom == vbi->wanttop) { + vbiscreen_tab (vbi->vs, b2 & 3); } vbi->lastcode = (b1 << 8) | b2; return 1; } switch ((code = b2 & 15)) { - case 0: /* POP-UP */ - case 5: /* ROLL UP 2 */ - case 6: /* ROLL UP 3 */ - case 7: /* ROLL UP 4 */ - case 9: /* PAINT-ON */ - case 10: /* TEXT */ - case 11: /* TEXT */ - vbi->initialised = 1; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - /* This is the repeated Control Code */ - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; - } - switch (code) { - case 0: /* POP-UP */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Pop-Up\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, POP_UP); - } - break; - case 5: /* ROLL UP 2 */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Roll-Up 2 (RU2)\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, ROLL_2); - } - break; - case 6: /* ROLL UP 3 */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Roll-Up 3 (RU3)\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, ROLL_3); - } - break; - case 7: /* ROLL UP 4 */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Roll-Up 4 (RU4)\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, ROLL_4); - } - break; - case 9: /* PAINT-ON */ - if (!vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Paint-On\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 0; - vbiscreen_set_mode (vbi->vs, 1, PAINT_ON); - } - break; - case 10: /* TEXT */ - if (vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Text Restart\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 1; - vbiscreen_set_mode (vbi->vs, 0, 0); - } - break; - case 11: /* TEXT */ - if (vbi->wanttext && vbi->current_chan == vbi->chan && - !bottom == vbi->wanttop) { - if (vbi->verbose) - fprintf (stderr, "Resume Text Display\n"); - vbi->indent = vbi->current_indent; - vbi->ital = vbi->current_ital; - vbi->colour = vbi->current_colour; - vbi->row = vbi->current_row; - vbi->current_istext = 1; - vbiscreen_set_mode (vbi->vs, 0, 0); - } - break; - default: /* impossible */ - break; - } - break; + case 0: /* POP-UP */ + case 5: /* ROLL UP 2 */ + case 6: /* ROLL UP 3 */ + case 7: /* ROLL UP 4 */ + case 9: /* PAINT-ON */ + case 10: /* TEXT */ + case 11: /* TEXT */ + vbi->initialised = 1; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + /* This is the repeated Control Code */ + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; + } + switch (code) { + case 0: /* POP-UP */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Pop-Up\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, POP_UP); + } + break; + case 5: /* ROLL UP 2 */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Roll-Up 2 (RU2)\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, ROLL_2); + } + break; + case 6: /* ROLL UP 3 */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Roll-Up 3 (RU3)\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, ROLL_3); + } + break; + case 7: /* ROLL UP 4 */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Roll-Up 4 (RU4)\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, ROLL_4); + } + break; + case 9: /* PAINT-ON */ + if (!vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Paint-On\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 0; + vbiscreen_set_mode (vbi->vs, 1, PAINT_ON); + } + break; + case 10: /* TEXT */ + if (vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Text Restart\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 1; + vbiscreen_set_mode (vbi->vs, 0, 0); + } + break; + case 11: /* TEXT */ + if (vbi->wanttext && vbi->current_chan == vbi->chan && + !bottom == vbi->wanttop) { + if (vbi->verbose) + fprintf (stderr, "Resume Text Display\n"); + vbi->indent = vbi->current_indent; + vbi->ital = vbi->current_ital; + vbi->colour = vbi->current_colour; + vbi->row = vbi->current_row; + vbi->current_istext = 1; + vbiscreen_set_mode (vbi->vs, 0, 0); + } + break; + default: /* impossible */ + break; + } + break; case 1: - if (!vbi->initialised) - return 0; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - } - if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Backspace\n"); - vbiscreen_backspace (vbi->vs); - } - break; + if (!vbi->initialised) + return 0; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + vbi->lastcount = (vbi->lastcount + 1) % 2; + } + if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Backspace\n"); + vbiscreen_backspace (vbi->vs); + } + break; case 2: case 3: - if (!vbi->initialised) - return 0; - fprintf (stderr, "Reserved\n"); - break; + if (!vbi->initialised) + return 0; + fprintf (stderr, "Reserved\n"); + break; case 4: - if (!vbi->initialised) - return 0; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - } - if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Delete to End of Row\n"); - vbiscreen_delete_to_end (vbi->vs); - } - break; + if (!vbi->initialised) + return 0; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + vbi->lastcount = (vbi->lastcount + 1) % 2; + } + if (!bottom == vbi->wanttop && vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Delete to End of Row\n"); + vbiscreen_delete_to_end (vbi->vs); + } + break; case 8: - if (!vbi->initialised) - return 0; - if (vbi->verbose) - fprintf (stderr, "Flash On\n"); - break; + if (!vbi->initialised) + return 0; + if (vbi->verbose) + fprintf (stderr, "Flash On\n"); + break; case 12: case 13: case 14: case 15: - if (!vbi->initialised) - return 0; - if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { - vbi->lastcount = (vbi->lastcount + 1) % 2; - return 1; - } - - switch (code) { - case 12: - /* Show buffer 1, Fill buffer 2 */ - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Erase Displayed Memory\n"); - vbiscreen_erase_displayed (vbi->vs); - } - break; - case 13: - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Carriage Return\n"); - vbiscreen_carriage_return (vbi->vs); - } - break; - case 14: - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "Erase Non-Displayed\n"); - vbiscreen_erase_non_displayed (vbi->vs); - } - break; - case 15: - /* Show buffer 2, Fill Buffer 1 */ - if (!bottom == vbi->wanttop && - vbi->current_chan == vbi->chan && - vbi->current_istext == vbi->wanttext) { - if (vbi->verbose) - fprintf (stderr, "End Of Caption\n"); - vbiscreen_end_of_caption (vbi->vs); - } - break; - default: /* impossible */ - return 0; - break; - } - break; - default: /* Impossible */ - return 0; - break; + if (!vbi->initialised) + return 0; + if (!bottom && vbi->lastcode == ((b1 << 8) | b2)) { + vbi->lastcount = (vbi->lastcount + 1) % 2; + return 1; + } + + switch (code) { + case 12: + /* Show buffer 1, Fill buffer 2 */ + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Erase Displayed Memory\n"); + vbiscreen_erase_displayed (vbi->vs); + } + break; + case 13: + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Carriage Return\n"); + vbiscreen_carriage_return (vbi->vs); + } + break; + case 14: + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "Erase Non-Displayed\n"); + vbiscreen_erase_non_displayed (vbi->vs); + } + break; + case 15: + /* Show buffer 2, Fill Buffer 1 */ + if (!bottom == vbi->wanttop && + vbi->current_chan == vbi->chan && + vbi->current_istext == vbi->wanttext) { + if (vbi->verbose) + fprintf (stderr, "End Of Caption\n"); + vbiscreen_end_of_caption (vbi->vs); + } + break; + default: /* impossible */ + return 0; + break; + } + break; + default: /* Impossible */ + return 0; + break; } if (vbi->lastcode != ((b1 << 8) | b2)) { @@ -932,33 +932,33 @@ Process16b (vbidata_t * vbi, int bottom, int w1) switch (b1) { case 0x1A: case 0x12: - /* use extcode1 */ - if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) - if (vbi->verbose) - fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, - extcode1[b1 - 32], b2, extcode1[b2 - 32]); + /* use extcode1 */ + if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) + if (vbi->verbose) + fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, + extcode1[b1 - 32], b2, extcode1[b2 - 32]); - break; + break; case 0x13: case 0x1B: - /* use extcode2 */ - if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) - if (vbi->verbose) - fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, - extcode2[b1 - 32], b2, extcode2[b2 - 32]); + /* use extcode2 */ + if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) + if (vbi->verbose) + fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, + extcode2[b1 - 32], b2, extcode2[b2 - 32]); - break; + break; case 0x11: case 0x19: - /* use wcode */ - if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) - if (vbi->verbose) - fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, - wccode[b1 - 32], b2, wccode[b2 - 32]); + /* use wcode */ + if (b1 > 31 && b2 > 31 && b1 <= 0x3F && b2 <= 0x3F) + if (vbi->verbose) + fprintf (stderr, "char %d (%c), char %d (%c)\n", b1, + wccode[b1 - 32], b2, wccode[b2 - 32]); - break; + break; default: - break; + break; } } else if (b1) { /* use ccode */ @@ -968,13 +968,13 @@ Process16b (vbidata_t * vbi, int bottom, int w1) b2 = 32; if (vbi->verbose) fprintf (stderr, "vbidata: data: %c %c\n", ccode[b1 - 32], - ccode[b2 - 32]); + ccode[b2 - 32]); vbiscreen_print (vbi->vs, ccode[b1 - 32], ccode[b2 - 32]); } return 1; -} /* Process16b */ +} /* Process16b */ int ProcessLine (vbidata_t * vbi, unsigned char *s, int bottom) @@ -989,7 +989,7 @@ ProcessLine (vbidata_t * vbi, unsigned char *s, int bottom) w1 = ccdecode (s); return Process16b (vbi, bottom, w1); -} /* ProcessLine */ +} /* ProcessLine */ @@ -1006,7 +1006,7 @@ vbidata_new_file (const char *filename, vbiscreen_t * vs, vbi->fd = open (filename, O_RDONLY); if (vbi->fd < 0) { fprintf (stderr, "vbidata: Can't open %s: %s\n", - filename, strerror (errno)); + filename, strerror (errno)); free (vbi); return 0; } diff --git a/gst/vbidec/vbiscreen.c b/gst/vbidec/vbiscreen.c index f441ba78..bad96b52 100644 --- a/gst/vbidec/vbiscreen.c +++ b/gst/vbidec/vbiscreen.c @@ -144,16 +144,16 @@ struct vbiscreen_s int frame_height; int frame_aspect; - int x, y; /* where to draw console */ - int width, height; /* the size box we have to draw in */ + int x, y; /* where to draw console */ + int width, height; /* the size box we have to draw in */ int rowheight, charwidth; - int curx, cury; /* cursor position */ - int rows, cols; /* 32 cols 15 rows */ - int captions, style; /* CC (1) or Text (0), RU2 RU3 RU4 POP_UP PAINT_ON */ - int first_line; /* where to start drawing */ + int curx, cury; /* cursor position */ + int rows, cols; /* 32 cols 15 rows */ + int captions, style; /* CC (1) or Text (0), RU2 RU3 RU4 POP_UP PAINT_ON */ + int first_line; /* where to start drawing */ int curbuffer; - int top_of_screen; /* a pointer into line[] */ + int top_of_screen; /* a pointer into line[] */ int indent; int got_eoc; int scroll; @@ -184,8 +184,8 @@ vbiscreen_new (int video_width, int video_height, vs->frame_aspect = video_aspect; vs->curx = 0; vs->cury = 0; - vs->fgcolour = 0xFFFFFFFFU; /* white */ - vs->bgcolour = 0xFF000000U; /* black */ + vs->fgcolour = 0xFFFFFFFFU; /* white */ + vs->bgcolour = 0xFF000000U; /* black */ vs->bg_luma = 16; vs->bg_cb = 128; vs->bg_cr = 128; @@ -216,7 +216,7 @@ vbiscreen_new (int video_width, int video_height, vs->fontfile = "./FreeMonoBold.ttf"; vs->line[0] = osd_string_new (vs->fontfile, fontsize, - video_width, video_height, video_aspect, user_data); + video_width, video_height, video_aspect, user_data); } if (!vs->line[0]) { @@ -232,15 +232,15 @@ vbiscreen_new (int video_width, int video_height, for (i = 0; i < ROWS; i++) { vs->line[i] = osd_string_new (vs->fontfile, fontsize, - video_width, video_height, video_aspect, user_data); + video_width, video_height, video_aspect, user_data); if (!vs->line[i]) { fprintf (stderr, "vbiscreen: Could not allocate a line.\n"); vbiscreen_delete (vs); return NULL; } osd_string_set_colour_rgb (vs->line[i], - (vs->fgcolour & 0xff0000) >> 16, - (vs->fgcolour & 0xff00) >> 8, (vs->fgcolour & 0xff)); + (vs->fgcolour & 0xff0000) >> 16, + (vs->fgcolour & 0xff00) >> 8, (vs->fgcolour & 0xff)); osd_string_show_text (vs->line[i], " ", 0); } memset (vs->text, 0, 2 * ROWS * COLS); @@ -418,7 +418,7 @@ scroll_screen (vbiscreen_t * vs) start_row = (vs->first_line + vs->top_of_screen) % (2 * ROWS); if (vs->verbose) fprintf (stderr, "start row : %d first line %d\n ", start_row, - vs->first_line); + vs->first_line); /* zero out top row */ memset ((char *) (vs->text + start_row * COLS), 0, COLS); @@ -444,7 +444,7 @@ vbiscreen_new_caption (vbiscreen_t * vs, int indent, int ital, return; if (vs->verbose) fprintf (stderr, "indent: %d, ital: %d, colour: 0x%x, row: %d\n", indent, - ital, colour, row); + ital, colour, row); if (0 && vs->captions && vs->style <= ROLL_4 && vs->style) { if (row != vs->cury + 1) { @@ -476,22 +476,22 @@ vbiscreen_set_mode (vbiscreen_t * vs, int caption, int style) fprintf (stderr, "Caption: %d ", caption); switch (style) { case ROLL_2: - fprintf (stderr, "ROLL 2\n"); - break; + fprintf (stderr, "ROLL 2\n"); + break; case ROLL_3: - fprintf (stderr, "ROLL 3\n"); - break; + fprintf (stderr, "ROLL 3\n"); + break; case ROLL_4: - fprintf (stderr, "ROLL 4\n"); - break; + fprintf (stderr, "ROLL 4\n"); + break; case POP_UP: - fprintf (stderr, "POP UP\n"); - break; + fprintf (stderr, "POP UP\n"); + break; case PAINT_ON: - fprintf (stderr, "PAINT ON\n"); - break; + fprintf (stderr, "PAINT ON\n"); + break; default: - break; + break; } } if (!caption) { @@ -510,21 +510,21 @@ vbiscreen_set_mode (vbiscreen_t * vs, int caption, int style) case ROLL_2: case ROLL_3: case ROLL_4: - if (vs->style == style) { - return; - } - vs->first_line = ROWS - (style - 4); + if (vs->style == style) { + return; + } + vs->first_line = ROWS - (style - 4); - if (vs->verbose) - fprintf (stderr, "first_line %d\n", vs->first_line); + if (vs->verbose) + fprintf (stderr, "first_line %d\n", vs->first_line); - vs->cury = ROWS - 1; - break; + vs->cury = ROWS - 1; + break; case POP_UP: - vs->got_eoc = 0; - break; + vs->got_eoc = 0; + break; case PAINT_ON: - break; + break; } } @@ -586,7 +586,7 @@ vbiscreen_delete_to_end (vbiscreen_t * vs) vbiscreen_clear_current_cell (vs); vs->curx++; } - vs->curx = COLS - 1; /* is this right ? */ + vs->curx = COLS - 1; /* is this right ? */ if (vs->captions && vs->style && vs->style != POP_UP) update_row (vs); } @@ -631,7 +631,7 @@ vbiscreen_erase_non_displayed (vbiscreen_t * vs) if (vs->captions && vs->style == POP_UP) { memset (vs->buffers + vs->curbuffer * COLS * ROWS + vs->cury * COLS, 0, - COLS); + COLS); // clear_hidden_pop( vs ); } else if (vs->captions && vs->style && vs->style <= ROLL_4) { clear_hidden_roll (vs); @@ -711,17 +711,17 @@ vbiscreen_print (vbiscreen_t * vs, char c1, char c2) /* this all gets displayed at another time */ if (vs->curx != COLS - 1) { *(vs->buffers + vs->curx + vs->curbuffer * ROWS * COLS + - vs->cury * COLS) = c1; + vs->cury * COLS) = c1; vs->curx++; } if (vs->curx != COLS - 1 && c2) { *(vs->buffers + vs->curx + vs->curbuffer * ROWS * COLS + - vs->cury * COLS) = c2; + vs->cury * COLS) = c2; vs->curx++; } else if (c2) { *(vs->buffers + vs->curx + vs->curbuffer * ROWS * COLS + - vs->cury * COLS) = c2; + vs->cury * COLS) = c2; } } @@ -783,40 +783,40 @@ vbiscreen_composite_packed422_scanline (vbiscreen_t * vs, if (0 && !vs->captions) blit_colour_packed422_scanline (output + (vs->x * 2), vs->width, - vs->bg_luma, vs->bg_cb, vs->bg_cr); + vs->bg_luma, vs->bg_cb, vs->bg_cr); index = vs->top_of_screen * COLS; x = (vs->x + vs->charwidth) & ~1; for (row = 0; row < ROWS; row++) { y = vs->y + row * vs->rowheight + vs->rowheight; if (osd_string_visible (vs->line[row])) { - if (scanline >= y && scanline < y + vs->rowheight) { + if (scanline >= y && scanline < y + vs->rowheight) { - int startx; - int strx; + int startx; + int strx; - startx = x - xpos; - strx = 0; + startx = x - xpos; + strx = 0; - if (startx < 0) { - strx = -startx; - startx = 0; - } + if (startx < 0) { + strx = -startx; + startx = 0; + } - if (startx < width) { + if (startx < width) { - if (vs->captions) - blit_colour_packed422_scanline (output + (startx * 2), - osd_string_get_width (vs->line[row]), - vs->bg_luma, vs->bg_cb, vs->bg_cr); + if (vs->captions) + blit_colour_packed422_scanline (output + (startx * 2), + osd_string_get_width (vs->line[row]), + vs->bg_luma, vs->bg_cb, vs->bg_cr); - osd_string_composite_packed422_scanline (vs->line[row], - output + (startx * 2), - output + (startx * 2), width - startx, strx, scanline - y); - } - } - index++; + osd_string_composite_packed422_scanline (vs->line[row], + output + (startx * 2), + output + (startx * 2), width - startx, strx, scanline - y); + } + } + index++; } } } diff --git a/gst/videocrop/gstvideocrop.c b/gst/videocrop/gstvideocrop.c index f13610bc..5e4c0b38 100644 --- a/gst/videocrop/gstvideocrop.c +++ b/gst/videocrop/gstvideocrop.c @@ -135,9 +135,10 @@ gst_video_crop_get_type (void) 0, (GInstanceInitFunc) gst_video_crop_init, }; + video_crop_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstVideoCrop", - &video_crop_info, 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstVideoCrop", + &video_crop_info, 0); } return video_crop_type; } @@ -167,16 +168,16 @@ gst_video_crop_class_init (GstVideoCropClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_LEFT, g_param_spec_int ("left", "Left", "Pixels to crop at left", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_RIGHT, g_param_spec_int ("right", "Right", "Pixels to crop at right", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_TOP, g_param_spec_int ("top", "Top", "Pixels to crop at top", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_BOTTOM, g_param_spec_int ("bottom", "Bottom", "Pixels to crop at bottom", - 0, G_MAXINT, 0, G_PARAM_READWRITE)); + 0, G_MAXINT, 0, G_PARAM_READWRITE)); gobject_class->set_property = gst_video_crop_set_property; gobject_class->get_property = gst_video_crop_get_property; @@ -369,8 +370,8 @@ gst_video_crop_chain (GstPad * pad, GstData * _data) switch (GST_EVENT_TYPE (event)) { default: - gst_pad_event_default (pad, event); - break; + gst_pad_event_default (pad, event); + break; } return; } diff --git a/gst/videodrop/gstvideodrop.c b/gst/videodrop/gstvideodrop.c index 6a83fd9d..e210f896 100644 --- a/gst/videodrop/gstvideodrop.c +++ b/gst/videodrop/gstvideodrop.c @@ -96,7 +96,7 @@ gst_videodrop_get_type (void) }; videodrop_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstVideodrop", &videodrop_info, 0); + "GstVideodrop", &videodrop_info, 0); } return videodrop_type; @@ -124,7 +124,7 @@ gst_videodrop_class_init (GstVideodropClass * klass) g_object_class_install_property (object_class, ARG_SPEED, g_param_spec_float ("speed", "Speed", - "Output speed (relative to input)", 0.01, 100, 1, G_PARAM_READWRITE)); + "Output speed (relative to input)", 0.01, 100, 1, G_PARAM_READWRITE)); object_class->set_property = gst_videodrop_set_property; object_class->get_property = gst_videodrop_get_property; @@ -151,7 +151,7 @@ gst_videodrop_getcaps (GstPad * pad) structure = gst_caps_get_structure (caps, i); gst_structure_set (structure, - "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL); + "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL); } return caps; @@ -244,13 +244,13 @@ gst_videodrop_chain (GstPad * pad, GstData * data) gint64 time; if (gst_event_discont_get_value (event, GST_FORMAT_TIME, &time)) { - videodrop->time_adjust = time; - videodrop->total = videodrop->pass = 0; + videodrop->time_adjust = time; + videodrop->total = videodrop->pass = 0; } else { - GST_ELEMENT_ERROR (videodrop, STREAM, TOO_LAZY, (NULL), - ("Received discont, but no time information")); - gst_event_unref (event); - return; + GST_ELEMENT_ERROR (videodrop, STREAM, TOO_LAZY, (NULL), + ("Received discont, but no time information")); + gst_event_unref (event); + return; } } @@ -262,7 +262,7 @@ gst_videodrop_chain (GstPad * pad, GstData * data) videodrop->total++; while (((GST_BUFFER_TIMESTAMP (buf) - videodrop->time_adjust) * - videodrop->to_fps * videodrop->speed / GST_SECOND) >= + videodrop->to_fps * videodrop->speed / GST_SECOND) >= videodrop->pass) { /* since we write to the struct (time/duration), we need a new struct, * but we don't want to copy around data - a subbuffer is the easiest @@ -271,7 +271,7 @@ gst_videodrop_chain (GstPad * pad, GstData * data) /* adjust timestamp/duration and push forward */ GST_BUFFER_TIMESTAMP (copy) = videodrop->time_adjust / videodrop->speed + - GST_SECOND * videodrop->pass / videodrop->to_fps; + GST_SECOND * videodrop->pass / videodrop->to_fps; GST_BUFFER_DURATION (copy) = GST_SECOND / videodrop->to_fps; gst_pad_push (videodrop->srcpad, GST_DATA (copy)); diff --git a/gst/virtualdub/gstvirtualdub.c b/gst/virtualdub/gstvirtualdub.c index 2495d449..cdaccf9f 100644 --- a/gst/virtualdub/gstvirtualdub.c +++ b/gst/virtualdub/gstvirtualdub.c @@ -46,21 +46,21 @@ gst_virtualdub_src_factory (void) if (!templ) { templ = GST_PAD_TEMPLATE_NEW ("src", - GST_PAD_SRC, - GST_PAD_ALWAYS, - GST_CAPS_NEW ("virtualdub_src", - "video/x-raw-rgb", - "bpp", GST_PROPS_INT (32), - "depth", GST_PROPS_INT (32), - "endianness", GST_PROPS_INT (G_BYTE_ORDER), - "red_mask", GST_PROPS_INT (0xff0000), - "green_mask", GST_PROPS_INT (0xff00), - "blue_mask", GST_PROPS_INT (0xff), - "width", GST_PROPS_INT_RANGE (16, 4096), - "height", GST_PROPS_INT_RANGE (16, 4096), - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) - ) - ); + GST_PAD_SRC, + GST_PAD_ALWAYS, + GST_CAPS_NEW ("virtualdub_src", + "video/x-raw-rgb", + "bpp", GST_PROPS_INT (32), + "depth", GST_PROPS_INT (32), + "endianness", GST_PROPS_INT (G_BYTE_ORDER), + "red_mask", GST_PROPS_INT (0xff0000), + "green_mask", GST_PROPS_INT (0xff00), + "blue_mask", GST_PROPS_INT (0xff), + "width", GST_PROPS_INT_RANGE (16, 4096), + "height", GST_PROPS_INT_RANGE (16, 4096), + "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) + ) + ); } return templ; } @@ -72,21 +72,21 @@ gst_virtualdub_sink_factory (void) if (!templ) { templ = GST_PAD_TEMPLATE_NEW ("sink", - GST_PAD_SINK, - GST_PAD_ALWAYS, - GST_CAPS_NEW ("virtualdub_sink", - "video/x-raw-rgb", - "bpp", GST_PROPS_INT (32), - "depth", GST_PROPS_INT (32), - "endianness", GST_PROPS_INT (G_BYTE_ORDER), - "red_mask", GST_PROPS_INT (0xff0000), - "green_mask", GST_PROPS_INT (0xff00), - "blue_mask", GST_PROPS_INT (0xff), - "width", GST_PROPS_INT_RANGE (16, 4096), - "height", GST_PROPS_INT_RANGE (16, 4096), - "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) - ) - ); + GST_PAD_SINK, + GST_PAD_ALWAYS, + GST_CAPS_NEW ("virtualdub_sink", + "video/x-raw-rgb", + "bpp", GST_PROPS_INT (32), + "depth", GST_PROPS_INT (32), + "endianness", GST_PROPS_INT (G_BYTE_ORDER), + "red_mask", GST_PROPS_INT (0xff0000), + "green_mask", GST_PROPS_INT (0xff00), + "blue_mask", GST_PROPS_INT (0xff), + "width", GST_PROPS_INT_RANGE (16, 4096), + "height", GST_PROPS_INT_RANGE (16, 4096), + "framerate", GST_PROPS_FLOAT_RANGE (0, G_MAXFLOAT) + ) + ); } return templ; } @@ -99,16 +99,16 @@ plugin_init (GModule * module, GstPlugin * plugin) while (_elements[i].name) { factory = gst_element_factory_new (_elements[i].name, - (_elements[i].type) (), _elements[i].details); + (_elements[i].type) (), _elements[i].details); if (!factory) { g_warning ("gst_virtualdub_new failed for `%s'", _elements[i].name); continue; } gst_element_factory_add_pad_template (factory, - gst_virtualdub_src_factory ()); + gst_virtualdub_src_factory ()); gst_element_factory_add_pad_template (factory, - gst_virtualdub_sink_factory ()); + gst_virtualdub_sink_factory ()); gst_plugin_add_feature (plugin, GST_PLUGIN_FEATURE (factory)); if (_elements[i].factoryinit) { diff --git a/gst/virtualdub/gstxsharpen.c b/gst/virtualdub/gstxsharpen.c index df4d4547..a8d5413c 100644 --- a/gst/virtualdub/gstxsharpen.c +++ b/gst/virtualdub/gstxsharpen.c @@ -107,8 +107,8 @@ gst_xsharpen_get_type (void) }; xsharpen_type = - g_type_register_static (GST_TYPE_ELEMENT, "GstXsharpen", &xsharpen_info, - 0); + g_type_register_static (GST_TYPE_ELEMENT, "GstXsharpen", &xsharpen_info, + 0); } return xsharpen_type; } @@ -126,11 +126,11 @@ gst_xsharpen_class_init (GstXsharpenClass * klass) g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_STRENGTH, g_param_spec_int ("strength", "strength", "strength", - 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); + 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_THRESHOLD, g_param_spec_int ("threshold", "threshold", "threshold", - 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); + 0, 255, 255, (GParamFlags) G_PARAM_READWRITE)); gobject_class->set_property = gst_xsharpen_set_property; gobject_class->get_property = gst_xsharpen_get_property; @@ -204,10 +204,10 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data) src = (Pixel *) ((char *) src_buf + (xsharpen->height - - 1) * xsharpen->srcpitch); + 1) * xsharpen->srcpitch); dst = (Pixel *) ((char *) dst_buf + (xsharpen->height - - 1) * xsharpen->dstpitch); + 1) * xsharpen->dstpitch); for (x = 0; x < xsharpen->width; x++) { dst[x] = src[x]; @@ -252,100 +252,100 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data) p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x - 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src - xsharpen->srcpitch))[x + 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = src[x - 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = src[x]; lumac = luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = src[x + 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x - 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } p = ((Pixel32 *) ((char *) src + xsharpen->srcpitch))[x + 1]; luma = p >> 24; if (luma > lumamax) { - lumamax = luma; - max = p; + lumamax = luma; + max = p; } if (luma < lumamin) { - lumamin = luma; - min = p; + lumamin = luma; + min = p; } /* Determine whether the current pixel is closer to the @@ -356,32 +356,32 @@ gst_xsharpen_chain (GstPad * pad, GstData * _data) p = -1; if (xsharpen->strength != 0) { - mindiff = lumac - lumamin; - maxdiff = lumamax - lumac; - if (mindiff > maxdiff) { - if (maxdiff < xsharpen->threshold) { - p = max; - } - } else { - if (mindiff < xsharpen->threshold) { - p = min; - } - } + mindiff = lumac - lumamin; + maxdiff = lumamax - lumac; + if (mindiff > maxdiff) { + if (maxdiff < xsharpen->threshold) { + p = max; + } + } else { + if (mindiff < xsharpen->threshold) { + p = min; + } + } } if (p == -1) { - dst[x] = src[x]; + dst[x] = src[x]; } else { - R = (src[x] >> 16) & 0xff; - G = (src[x] >> 8) & 0xff; - B = src[x] & 0xff; - r = (p >> 16) & 0xff; - g = (p >> 8) & 0xff; - b = p & 0xff; - r = (xsharpen->strength * r + xsharpen->strengthinv * R) / 255; - g = (xsharpen->strength * g + xsharpen->strengthinv * G) / 255; - b = (xsharpen->strength * b + xsharpen->strengthinv * B) / 255; - dst[x] = (r << 16) | (g << 8) | b; + R = (src[x] >> 16) & 0xff; + G = (src[x] >> 8) & 0xff; + B = src[x] & 0xff; + r = (p >> 16) & 0xff; + g = (p >> 8) & 0xff; + b = p & 0xff; + r = (xsharpen->strength * r + xsharpen->strengthinv * R) / 255; + g = (xsharpen->strength * g + xsharpen->strengthinv * G) / 255; + b = (xsharpen->strength * b + xsharpen->strengthinv * B) / 255; + dst[x] = (r << 16) | (g << 8) | b; } } src = (Pixel *) ((char *) src + xsharpen->srcpitch); diff --git a/gst/y4m/gsty4mencode.c b/gst/y4m/gsty4mencode.c index 3c9c9fbe..773f96b8 100644 --- a/gst/y4m/gsty4mencode.c +++ b/gst/y4m/gsty4mencode.c @@ -92,8 +92,9 @@ gst_y4mencode_get_type (void) 0, (GInstanceInitFunc) gst_y4mencode_init, }; + y4mencode_type = g_type_register_static (GST_TYPE_ELEMENT, - "GstY4mEncode", &y4mencode_info, 0); + "GstY4mEncode", &y4mencode_info, 0); } return y4mencode_type; } @@ -135,9 +136,9 @@ gst_y4mencode_sinkconnect (GstPad * pad, const GstCaps * caps) gdouble fps; gdouble framerates[] = { 00.000, - 23.976, 24.000, /* 24fps movie */ - 25.000, /* PAL */ - 29.970, 30.000, /* NTSC */ + 23.976, 24.000, /* 24fps movie */ + 25.000, /* PAL */ + 29.970, 30.000, /* NTSC */ 50.000, 59.940, 60.000 }; @@ -157,10 +158,10 @@ gst_y4mencode_sinkconnect (GstPad * pad, const GstCaps * caps) idx = i; } else { gdouble old_diff = fabs (framerates[idx] - fps), - new_diff = fabs (framerates[i] - fps); + new_diff = fabs (framerates[i] - fps); if (new_diff < old_diff) { - idx = i; + idx = i; } } } -- cgit v1.2.1