[gstreamer-bugs] [Bug 595286] dvdec rank MARGINAL, yet it is the only dv decoder that does PAR properly

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Wed Sep 15 15:59:57 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=595286
  GStreamer | gst-plugins-good | git

--- Comment #4 from David Schleef <ds at schleef.org> 2010-09-15 22:59:51 UTC ---
Feel free to use this code in gst-ffmpeg and modify as necessary.  If is_wide
is false, par is 10/11 (NTSC) or 12/11 (PAL).  If is_wide is true, multiply
that by 4/3.  is_422 is not relevant here, interlaced and top_field_first are
useful too.

dvdec doesn't handle a lot of the DV varieties that ffdec_dv does.

/* Copyright 2009 Entropy Wave Inc, used with permission */

static int
get_vaux_offset (int dif, int vaux)
{
  int offset;

  offset = dif * 12000;         /* to dif */
  offset += 80 * (3 + (vaux / 15));    /* to subcode pack */
  offset += 3;                  /* past header */
  offset += 5 * (vaux % 15);     /* to vaux */

  return offset;
}

static void
get_info (EwDVDec *decoder, const guint8 *data)
{
  int offset;
  int dif;
  int n_difs = decoder->is_625 ? 12 : 10;

  for(dif=0;dif<n_difs;dif++) {
    offset = get_vaux_offset (dif, (dif&1) ? 0 : 39);
    GST_DEBUG("%02x",data[offset + 0]);
    if (data[offset + 0] == 0x60) {
      if ((data[offset + 3] & 0x1f) == 4) {
        GST_DEBUG("4:2:2 compression");
        decoder->is_422 = TRUE;
      } else {
        decoder->is_422 = FALSE;
      }
      break;
    }
  }
  if (dif==n_difs) {
    GST_ERROR("failed to find VAUX source pack");
  }

  for(dif=0;dif<n_difs;dif++) {
    offset = get_vaux_offset (dif, (dif&1) ? 1 : 40);
    GST_DEBUG("%02x",data[offset + 0]);
    if (data[offset + 0] == 0x61) {
      if ((data[offset + 2] & 7) == 2) {
        decoder->is_wide = TRUE;
      } else {
        decoder->is_wide = FALSE;
      }
      if (data[offset + 3] & 0x10) {
        decoder->base_video_decoder.state.interlaced = TRUE;
      } else {
        decoder->base_video_decoder.state.interlaced = FALSE;
      }
      GST_DEBUG("is_wide %d interlaced %d",
          decoder->is_wide,
          decoder->base_video_decoder.state.interlaced);
      break;
    }
  }
  if (dif==n_difs) {
    GST_ERROR("failed to find VAUX source control pack");
  }

  decoder->base_video_decoder.state.top_field_first = FALSE;
}

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list