Commit abd7e33d authored by Wim Taymans's avatar Wim Taymans

deinterlace: add support for strides

Implement stride support correctly by taking it from the GstVideoFrame.
Propose a bufferpool upstream when not operating in passthrough.
parent 3503aef9
......@@ -2367,6 +2367,7 @@ gst_deinterlace_do_bufferpool (GstDeinterlace * self, GstCaps * outcaps)
config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set_params (config, outcaps, size, min, max);
gst_buffer_pool_config_set_allocator (config, allocator, &params);
gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);
gst_buffer_pool_set_config (pool, config);
/* now store */
......@@ -2590,6 +2591,33 @@ gst_deinterlace_sink_event (GstPad * pad, GstObject * parent, GstEvent * event)
return res;
}
static gboolean
gst_deinterlace_propose_allocation (GstDeinterlace * self, GstQuery * query)
{
GstBufferPool *pool;
GstCaps *caps;
GstVideoInfo info;
guint size;
gst_query_parse_allocation (query, &caps, NULL);
if (caps == NULL)
return FALSE;
if (!gst_video_info_from_caps (&info, caps))
return FALSE;
size = GST_VIDEO_INFO_SIZE (&info);
pool = gst_video_buffer_pool_new ();
gst_query_add_allocation_pool (query, pool, size, 0, 0);
gst_object_unref (pool);
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
return TRUE;
}
static gboolean
gst_deinterlace_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
{
......@@ -2614,7 +2642,7 @@ gst_deinterlace_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
if (self->passthrough)
res = gst_pad_peer_query (self->srcpad, query);
else
res = gst_pad_query_default (pad, parent, query);
res = gst_deinterlace_propose_allocation (self, query);
break;
default:
res = gst_pad_query_default (pad, parent, query);
......
......@@ -25,7 +25,7 @@
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideopool.h>
#include <gst/video/gstvideofilter.h>
#include <gst/video/gstvideometa.h>
#include "gstdeinterlacemethod.h"
......
This diff is collapsed.
......@@ -68,12 +68,6 @@ struct _GstDeinterlaceMethod {
GstObject parent;
GstVideoInfo *vinfo;
// FIXME - the stuff below can use vinfo and macros
gint width[4];
gint height[4];
gint offset[4];
gint row_stride[4];
gint pixel_stride[4];
GstDeinterlaceMethodDeinterlaceFunction deinterlace_frame;
};
......@@ -166,7 +160,7 @@ struct _GstDeinterlaceScanlineData {
* All other values are NULL.
*/
typedef void (*GstDeinterlaceSimpleMethodFunction) (GstDeinterlaceSimpleMethod *self, guint8 *out, const GstDeinterlaceScanlineData *scanlines);
typedef void (*GstDeinterlaceSimpleMethodFunction) (GstDeinterlaceSimpleMethod *self, guint8 *out, const GstDeinterlaceScanlineData *scanlines, guint size);
struct _GstDeinterlaceSimpleMethod {
GstDeinterlaceMethod parent;
......
......@@ -70,71 +70,67 @@ typedef GstDeinterlaceSimpleMethodClass GstDeinterlaceMethodGreedyLClass;
static inline void
deinterlace_greedy_interpolate_scanline_orc (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
guint max_comb = GST_DEINTERLACE_METHOD_GREEDY_L (self)->max_comb;
if (scanlines->m1 == NULL || scanlines->mp == NULL) {
deinterlace_line_linear (out, scanlines->t0, scanlines->b0,
self->parent.row_stride[0]);
deinterlace_line_linear (out, scanlines->t0, scanlines->b0, size);
} else {
deinterlace_line_greedy (out, scanlines->m1, scanlines->t0, scanlines->b0,
scanlines->mp ? scanlines->mp : scanlines->m1,
max_comb, self->parent.row_stride[0]);
scanlines->mp ? scanlines->mp : scanlines->m1, max_comb, size);
}
}
static inline void
deinterlace_greedy_interpolate_scanline_orc_planar_u (GstDeinterlaceSimpleMethod
* self, guint8 * out, const GstDeinterlaceScanlineData * scanlines)
* self, guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint
size)
{
guint max_comb = GST_DEINTERLACE_METHOD_GREEDY_L (self)->max_comb;
if (scanlines->m1 == NULL || scanlines->mp == NULL) {
deinterlace_line_linear (out, scanlines->t0, scanlines->b0,
self->parent.row_stride[1]);
deinterlace_line_linear (out, scanlines->t0, scanlines->b0, size);
} else {
deinterlace_line_greedy (out, scanlines->m1, scanlines->t0, scanlines->b0,
scanlines->mp ? scanlines->mp : scanlines->m1,
max_comb, self->parent.row_stride[1]);
scanlines->mp ? scanlines->mp : scanlines->m1, max_comb, size);
}
}
static inline void
deinterlace_greedy_interpolate_scanline_orc_planar_v (GstDeinterlaceSimpleMethod
* self, guint8 * out, const GstDeinterlaceScanlineData * scanlines)
* self, guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint
size)
{
guint max_comb = GST_DEINTERLACE_METHOD_GREEDY_L (self)->max_comb;
if (scanlines->m1 == NULL || scanlines->mp == NULL) {
deinterlace_line_linear (out, scanlines->t0, scanlines->b0,
self->parent.row_stride[2]);
deinterlace_line_linear (out, scanlines->t0, scanlines->b0, size);
} else {
deinterlace_line_greedy (out, scanlines->m1, scanlines->t0, scanlines->b0,
scanlines->mp ? scanlines->mp : scanlines->m1,
max_comb, self->parent.row_stride[2]);
scanlines->mp ? scanlines->mp : scanlines->m1, max_comb, size);
}
}
static void
deinterlace_greedy_copy_scanline (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[0]);
memcpy (out, scanlines->m0, size);
}
static void
deinterlace_greedy_copy_scanline_planar_u (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[1]);
memcpy (out, scanlines->m0, size);
}
static void
deinterlace_greedy_copy_scanline_planar_v (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[2]);
memcpy (out, scanlines->m0, size);
}
G_DEFINE_TYPE (GstDeinterlaceMethodGreedyL, gst_deinterlace_method_greedy_l,
......
......@@ -726,9 +726,9 @@ deinterlace_frame_di_greedyh_packed (GstDeinterlaceMethod * method,
GST_DEINTERLACE_METHOD_GREEDY_H_GET_CLASS (self);
gint InfoIsOdd = 0;
gint Line;
gint RowStride = method->row_stride[0];
gint RowStride = GST_VIDEO_FRAME_COMP_STRIDE (outframe, 0);
gint FieldHeight = GST_VIDEO_INFO_HEIGHT (method->vinfo) / 2;
gint Pitch = method->row_stride[0] * 2;
gint Pitch = RowStride * 2;
const guint8 *L1; // ptr to Line1, of 3
const guint8 *L2; // ptr to Line2, the weave line
const guint8 *L3; // ptr to Line3
......@@ -912,9 +912,9 @@ deinterlace_frame_di_greedyh_planar (GstDeinterlaceMethod * method,
for (i = 0; i < 3; i++) {
InfoIsOdd = (history[cur_field_idx - 1].flags == PICTURE_INTERLACED_BOTTOM);
RowStride = method->row_stride[i];
FieldHeight = method->height[i] / 2;
Pitch = method->row_stride[i] * 2;
RowStride = GST_VIDEO_FRAME_PLANE_STRIDE (outframe, i);
FieldHeight = GST_VIDEO_FRAME_HEIGHT (outframe) / 2;
Pitch = RowStride * 2;
if (i == 0)
scanline = klass->scanline_planar_y;
......
......@@ -56,34 +56,30 @@ deinterlace_scanline_linear_c (GstDeinterlaceSimpleMethod * self,
static void
deinterlace_scanline_linear_packed_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0,
self->parent.row_stride[0]);
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0, size);
}
static void
deinterlace_scanline_linear_planar_y_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0,
self->parent.row_stride[0]);
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0, size);
}
static void
deinterlace_scanline_linear_planar_u_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0,
self->parent.row_stride[1]);
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0, size);
}
static void
deinterlace_scanline_linear_planar_v_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0,
self->parent.row_stride[2]);
deinterlace_scanline_linear_c (self, out, scanlines->t0, scanlines->b0, size);
}
G_DEFINE_TYPE (GstDeinterlaceMethodLinear, gst_deinterlace_method_linear,
......
......@@ -65,34 +65,34 @@ deinterlace_scanline_linear_blend_c (GstDeinterlaceSimpleMethod * self,
static void
deinterlace_scanline_linear_blend_packed_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_blend_c (self, out, scanlines->t0, scanlines->b0,
scanlines->m1, self->parent.row_stride[0]);
scanlines->m1, size);
}
static void
deinterlace_scanline_linear_blend_planar_y_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_blend_c (self, out, scanlines->t0, scanlines->b0,
scanlines->m1, self->parent.row_stride[0]);
scanlines->m1, size);
}
static void
deinterlace_scanline_linear_blend_planar_u_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_blend_c (self, out, scanlines->t0, scanlines->b0,
scanlines->m1, self->parent.row_stride[1]);
scanlines->m1, size);
}
static void
deinterlace_scanline_linear_blend_planar_v_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_blend_c (self, out, scanlines->t0, scanlines->b0,
scanlines->m1, self->parent.row_stride[2]);
scanlines->m1, size);
}
static inline void
......@@ -109,34 +109,37 @@ deinterlace_scanline_linear_blend2_c (GstDeinterlaceSimpleMethod * self,
static void
deinterlace_scanline_linear_blend2_packed_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
deinterlace_scanline_linear_blend2_c (self, out, scanlines->m0, scanlines->t1,
scanlines->b1, self->parent.row_stride[0]);
scanlines->b1, size);
}
static void
deinterlace_scanline_linear_blend2_planar_y_c (GstDeinterlaceSimpleMethod *
self, guint8 * out, const GstDeinterlaceScanlineData * scanlines)
self, guint8 * out, const GstDeinterlaceScanlineData * scanlines,
guint size)
{
deinterlace_scanline_linear_blend2_c (self, out, scanlines->m0, scanlines->t1,
scanlines->b1, self->parent.row_stride[0]);
scanlines->b1, size);
}
static void
deinterlace_scanline_linear_blend2_planar_u_c (GstDeinterlaceSimpleMethod *
self, guint8 * out, const GstDeinterlaceScanlineData * scanlines)
self, guint8 * out, const GstDeinterlaceScanlineData * scanlines,
guint size)
{
deinterlace_scanline_linear_blend2_c (self, out, scanlines->m0, scanlines->t1,
scanlines->b1, self->parent.row_stride[1]);
scanlines->b1, size);
}
static void
deinterlace_scanline_linear_blend2_planar_v_c (GstDeinterlaceSimpleMethod *
self, guint8 * out, const GstDeinterlaceScanlineData * scanlines)
self, guint8 * out, const GstDeinterlaceScanlineData * scanlines,
guint size)
{
deinterlace_scanline_linear_blend2_c (self, out, scanlines->m0, scanlines->t1,
scanlines->b1, self->parent.row_stride[2]);
scanlines->b1, size);
}
G_DEFINE_TYPE (GstDeinterlaceMethodLinearBlend,
......
......@@ -40,30 +40,30 @@ typedef GstDeinterlaceSimpleMethodClass GstDeinterlaceMethodScalerBobClass;
static void
deinterlace_scanline_scaler_bob_packed (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->t0, self->parent.row_stride[0]);
memcpy (out, scanlines->t0, size);
}
static void
deinterlace_scanline_scaler_bob_planar_y (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->t0, self->parent.row_stride[0]);
memcpy (out, scanlines->t0, size);
}
static void
deinterlace_scanline_scaler_bob_planar_u (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->t0, self->parent.row_stride[1]);
memcpy (out, scanlines->t0, size);
}
static void
deinterlace_scanline_scaler_bob_planar_v (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->t0, self->parent.row_stride[2]);
memcpy (out, scanlines->t0, size);
}
G_DEFINE_TYPE (GstDeinterlaceMethodScalerBob, gst_deinterlace_method_scaler_bob,
......
......@@ -95,23 +95,24 @@ static void FUNCT_NAME(GstDeinterlaceMethod *d_method,
}
/* double stride do address just every odd/even scanline */
src_pitch = self->parent.row_stride[0]*2;
dst_pitch = self->parent.row_stride[0];
rowsize = self->parent.row_stride[0];
src_pitch = GST_VIDEO_FRAME_PLANE_STRIDE (outframe, 0) * 2;
dst_pitch = GST_VIDEO_FRAME_PLANE_STRIDE (outframe, 0);
rowsize = GST_VIDEO_FRAME_PLANE_STRIDE (outframe, 0);
FldHeight = GST_VIDEO_INFO_HEIGHT (self->parent.vinfo) / 2;
pCopySrc = GST_VIDEO_FRAME_PLANE_DATA (history[history_count-1].frame, 0);
if (history[history_count - 1].flags & PICTURE_INTERLACED_BOTTOM)
pCopySrc += rowsize;
pCopySrc += GST_VIDEO_FRAME_PLANE_STRIDE (history[history_count-1].frame, 0);
pCopySrcP = GST_VIDEO_FRAME_PLANE_DATA (history[history_count-3].frame, 0);
if (history[history_count - 3].flags & PICTURE_INTERLACED_BOTTOM)
pCopySrcP += rowsize;
pCopySrcP += GST_VIDEO_FRAME_PLANE_STRIDE (history[history_count-3].frame, 0);
pWeaveSrc = GST_VIDEO_FRAME_PLANE_DATA (history[history_count-2].frame, 0);
if (history[history_count - 2].flags & PICTURE_INTERLACED_BOTTOM)
pWeaveSrc += rowsize;
pWeaveSrc += GST_VIDEO_FRAME_PLANE_STRIDE (history[history_count-2].frame, 0);
pWeaveSrcP = GST_VIDEO_FRAME_PLANE_DATA (history[history_count-4].frame, 0);
if (history[history_count - 4].flags & PICTURE_INTERLACED_BOTTOM)
pWeaveSrcP += rowsize;
pWeaveSrcP += GST_VIDEO_FRAME_PLANE_STRIDE (history[history_count-4].frame, 0);
/* use bottom field and interlace top field */
if (history[history_count-2].flags == PICTURE_INTERLACED_BOTTOM) {
......
......@@ -77,56 +77,52 @@ deinterlace_c (guint8 * dst, const guint8 * lum_m4, const guint8 * lum_m3,
static void
deinterlace_line_packed_c (GstDeinterlaceSimpleMethod * self, guint8 * dst,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
const guint8 *lum_m4 = scanlines->tt1;
const guint8 *lum_m3 = scanlines->t0;
const guint8 *lum_m2 = scanlines->m1;
const guint8 *lum_m1 = scanlines->b0;
const guint8 *lum = scanlines->bb1;
gint size = self->parent.row_stride[0];
deinterlace_c (dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size);
}
static void
deinterlace_line_planar_y_c (GstDeinterlaceSimpleMethod * self, guint8 * dst,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
const guint8 *lum_m4 = scanlines->tt1;
const guint8 *lum_m3 = scanlines->t0;
const guint8 *lum_m2 = scanlines->m1;
const guint8 *lum_m1 = scanlines->b0;
const guint8 *lum = scanlines->bb1;
gint size = self->parent.row_stride[0];
deinterlace_c (dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size);
}
static void
deinterlace_line_planar_u_c (GstDeinterlaceSimpleMethod * self, guint8 * dst,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
const guint8 *lum_m4 = scanlines->tt1;
const guint8 *lum_m3 = scanlines->t0;
const guint8 *lum_m2 = scanlines->m1;
const guint8 *lum_m1 = scanlines->b0;
const guint8 *lum = scanlines->bb1;
gint size = self->parent.row_stride[1];
deinterlace_c (dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size);
}
static void
deinterlace_line_planar_v_c (GstDeinterlaceSimpleMethod * self, guint8 * dst,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
const guint8 *lum_m4 = scanlines->tt1;
const guint8 *lum_m3 = scanlines->t0;
const guint8 *lum_m2 = scanlines->m1;
const guint8 *lum_m1 = scanlines->b0;
const guint8 *lum = scanlines->bb1;
gint size = self->parent.row_stride[2];
deinterlace_c (dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size);
}
......
......@@ -46,74 +46,74 @@ typedef GstDeinterlaceSimpleMethodClass GstDeinterlaceMethodWeaveClass;
static void
deinterlace_scanline_weave_packed (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->t0, self->parent.row_stride[0]);
memcpy (out, scanlines->t0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[0]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_y (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->t0, self->parent.row_stride[0]);
memcpy (out, scanlines->t0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[0]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_u (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->t0, self->parent.row_stride[1]);
memcpy (out, scanlines->t0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[1]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_v (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->t0, self->parent.row_stride[2]);
memcpy (out, scanlines->t0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[2]);
memcpy (out, scanlines->m1, size);
}
}
static void
copy_scanline_packed (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[0]);
memcpy (out, scanlines->m0, size);
}
static void
copy_scanline_planar_y (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[0]);
memcpy (out, scanlines->m0, size);
}
static void
copy_scanline_planar_u (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[1]);
memcpy (out, scanlines->m0, size);
}
static void
copy_scanline_planar_v (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[2]);
memcpy (out, scanlines->m0, size);
}
G_DEFINE_TYPE (GstDeinterlaceMethodWeave, gst_deinterlace_method_weave,
......
......@@ -46,74 +46,74 @@ typedef GstDeinterlaceSimpleMethodClass GstDeinterlaceMethodWeaveBFFClass;
static void
deinterlace_scanline_weave_packed (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->b0, self->parent.row_stride[0]);
memcpy (out, scanlines->b0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[0]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_y (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->b0, self->parent.row_stride[0]);
memcpy (out, scanlines->b0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[0]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_u (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->b0, self->parent.row_stride[1]);
memcpy (out, scanlines->b0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[1]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_v (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->b0, self->parent.row_stride[2]);
memcpy (out, scanlines->b0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[2]);
memcpy (out, scanlines->m1, size);
}
}
static void
copy_scanline_packed (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[0]);
memcpy (out, scanlines->m0, size);
}
static void
copy_scanline_planar_y (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[0]);
memcpy (out, scanlines->m0, size);
}
static void
copy_scanline_planar_u (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[1]);
memcpy (out, scanlines->m0, size);
}
static void
copy_scanline_planar_v (GstDeinterlaceSimpleMethod * self, guint8 * out,
const GstDeinterlaceScanlineData * scanlines)
const GstDeinterlaceScanlineData * scanlines, guint size)
{
memcpy (out, scanlines->m0, self->parent.row_stride[2]);
memcpy (out, scanlines->m0, size);
}
G_DEFINE_TYPE (GstDeinterlaceMethodWeaveBFF, gst_deinterlace_method_weave_bff,
......
......@@ -47,74 +47,74 @@ typedef GstDeinterlaceSimpleMethodClass GstDeinterlaceMethodWeaveTFFClass;
static void
deinterlace_scanline_weave_packed (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->t0, self->parent.row_stride[0]);
memcpy (out, scanlines->t0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[0]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_y (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)
guint8 * out, const GstDeinterlaceScanlineData * scanlines, guint size)
{
if (scanlines->m1 == NULL) {
memcpy (out, scanlines->t0, self->parent.row_stride[0]);
memcpy (out, scanlines->t0, size);
} else {
memcpy (out, scanlines->m1, self->parent.row_stride[0]);
memcpy (out, scanlines->m1, size);
}
}
static void
deinterlace_scanline_weave_planar_u (GstDeinterlaceSimpleMethod * self,
guint8 * out, const GstDeinterlaceScanlineData * scanlines)