コード例 #1
0
static inline void
deinterlace_greedy_interpolate_scanline_orc (GstDeinterlaceSimpleMethod * 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, size);
  } else {
    deinterlace_line_greedy (out, scanlines->m1, scanlines->t0, scanlines->b0,
        scanlines->mp ? scanlines->mp : scanlines->m1, max_comb, size);
  }
}
コード例 #2
0
ファイル: greedy.c プロジェクト: spunktsch/svtplayer
static void
gst_deinterlace_method_greedy_l_get_property (GObject * object, guint prop_id,
    GValue * value, GParamSpec * pspec)
{
  GstDeinterlaceMethodGreedyL *self = GST_DEINTERLACE_METHOD_GREEDY_L (object);

  switch (prop_id) {
    case PROP_MAX_COMB:
      g_value_set_uint (value, self->max_comb);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
  }
}
コード例 #3
0
ファイル: greedy.c プロジェクト: spunktsch/svtplayer
static void
deinterlace_frame_di_greedy_planar (GstDeinterlaceMethod * method,
    const GstDeinterlaceField * history, guint history_count,
    GstBuffer * outbuf)
{
  GstDeinterlaceMethodGreedyL *self = GST_DEINTERLACE_METHOD_GREEDY_L (method);
  GstDeinterlaceMethodGreedyLClass *klass =
      GST_DEINTERLACE_METHOD_GREEDY_L_GET_CLASS (self);
  gint InfoIsOdd;
  gint RowStride;
  gint FieldHeight;
  gint Pitch;
  const guint8 *L1;             // ptr to Line1, of 3
  const guint8 *L2;             // ptr to Line2, the weave line
  const guint8 *L3;             // ptr to Line3
  const guint8 *L2P;            // ptr to prev Line2
  guint8 *Dest;
  gint i;
  gint Offset;
  GreedyLScanlineFunction scanline = klass->scanline;

  for (i = 0; i < 3; i++) {
    Offset = method->offset[i];

    InfoIsOdd = (history[history_count - 1].flags == PICTURE_INTERLACED_BOTTOM);
    RowStride = method->row_stride[i];
    FieldHeight = method->height[i] / 2;
    Pitch = method->row_stride[i] * 2;

    Dest = GST_BUFFER_DATA (outbuf) + Offset;

    L1 = GST_BUFFER_DATA (history[history_count - 2].buf) + Offset;
    if (history[history_count - 2].flags & PICTURE_INTERLACED_BOTTOM)
      L1 += RowStride;

    L2 = GST_BUFFER_DATA (history[history_count - 1].buf) + Offset;
    if (history[history_count - 1].flags & PICTURE_INTERLACED_BOTTOM)
      L2 += RowStride;

    L3 = L1 + Pitch;
    L2P = GST_BUFFER_DATA (history[history_count - 3].buf) + Offset;
    if (history[history_count - 3].flags & PICTURE_INTERLACED_BOTTOM)
      L2P += RowStride;

    deinterlace_frame_di_greedy_planar_plane (self, L1, L2, L3, L2P, Dest,
        RowStride, FieldHeight, Pitch, InfoIsOdd, scanline);
  }
}
コード例 #4
0
ファイル: greedy.c プロジェクト: spunktsch/svtplayer
static void
deinterlace_frame_di_greedy_packed (GstDeinterlaceMethod * method,
    const GstDeinterlaceField * history, guint history_count,
    GstBuffer * outbuf)
{
  GstDeinterlaceMethodGreedyL *self = GST_DEINTERLACE_METHOD_GREEDY_L (method);
  GstDeinterlaceMethodGreedyLClass *klass =
      GST_DEINTERLACE_METHOD_GREEDY_L_GET_CLASS (self);
  gint InfoIsOdd = 0;
  gint Line;
  gint RowStride = method->row_stride[0];
  gint FieldHeight = method->frame_height / 2;
  gint Pitch = method->row_stride[0] * 2;
  const guint8 *L1;             // ptr to Line1, of 3
  const guint8 *L2;             // ptr to Line2, the weave line
  const guint8 *L3;             // ptr to Line3
  const guint8 *L2P;            // ptr to prev Line2
  guint8 *Dest = GST_BUFFER_DATA (outbuf);

  // copy first even line no matter what, and the first odd line if we're
  // processing an EVEN field. (note diff from other deint rtns.)

  if (history[history_count - 1].flags == PICTURE_INTERLACED_BOTTOM) {
    InfoIsOdd = 1;

    L1 = GST_BUFFER_DATA (history[history_count - 2].buf);
    if (history[history_count - 2].flags & PICTURE_INTERLACED_BOTTOM)
      L1 += RowStride;

    L2 = GST_BUFFER_DATA (history[history_count - 1].buf);
    if (history[history_count - 1].flags & PICTURE_INTERLACED_BOTTOM)
      L2 += RowStride;

    L3 = L1 + Pitch;
    L2P = GST_BUFFER_DATA (history[history_count - 3].buf);
    if (history[history_count - 3].flags & PICTURE_INTERLACED_BOTTOM)
      L2P += RowStride;

    // copy first even line
    memcpy (Dest, L1, RowStride);
    Dest += RowStride;
  } else {
    InfoIsOdd = 0;
    L1 = GST_BUFFER_DATA (history[history_count - 2].buf);
    if (history[history_count - 2].flags & PICTURE_INTERLACED_BOTTOM)
      L1 += RowStride;

    L2 = GST_BUFFER_DATA (history[history_count - 1].buf) + Pitch;
    if (history[history_count - 1].flags & PICTURE_INTERLACED_BOTTOM)
      L2 += RowStride;

    L3 = L1 + Pitch;
    L2P = GST_BUFFER_DATA (history[history_count - 3].buf) + Pitch;
    if (history[history_count - 3].flags & PICTURE_INTERLACED_BOTTOM)
      L2P += RowStride;

    // copy first even line
    memcpy (Dest, L1, RowStride);
    Dest += RowStride;
    // then first odd line
    memcpy (Dest, L1, RowStride);
    Dest += RowStride;
  }

  for (Line = 0; Line < (FieldHeight - 1); ++Line) {
    klass->scanline (self, L2, L1, L3, L2P, Dest, RowStride);
    Dest += RowStride;
    memcpy (Dest, L3, RowStride);
    Dest += RowStride;

    L1 += Pitch;
    L2 += Pitch;
    L3 += Pitch;
    L2P += Pitch;
  }

  if (InfoIsOdd) {
    memcpy (Dest, L2, RowStride);
  }
}