Esempio n. 1
0
/* deinterlace - if not supported return -1 */
static int mlt_avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
                          int pix_fmt, int width, int height)
{
    int i;

    if (pix_fmt != PIX_FMT_YUV420P &&
        pix_fmt != PIX_FMT_YUV422P &&
        pix_fmt != PIX_FMT_YUYV422 &&
        pix_fmt != PIX_FMT_YUV444P &&
	pix_fmt != PIX_FMT_YUV411P)
        return -1;
    if ((width & 3) != 0 || (height & 3) != 0)
        return -1;

	if ( pix_fmt != PIX_FMT_YUYV422 )
	{
      for(i=0;i<3;i++) {
          if (i == 1) {
              switch(pix_fmt) {
              case PIX_FMT_YUV420P:
                  width >>= 1;
                  height >>= 1;
                  break;
              case PIX_FMT_YUV422P:
                  width >>= 1;
                  break;
              case PIX_FMT_YUV411P:
                  width >>= 2;
                  break;
              default:
                  break;
              }
          }
          if (src == dst) {
              deinterlace_bottom_field_inplace(dst->data[i], dst->linesize[i],
                                   width, height);
          } else {
              deinterlace_bottom_field(dst->data[i],dst->linesize[i],
                                          src->data[i], src->linesize[i],
                                          width, height);
          }
	  }
    }
	else {
      if (src == dst) {
Esempio n. 2
0
/* deinterlace - if not supported return -1 */
static int mlt_avpicture_deinterlace(uint8_t *dst_data[4], int dst_stride[4],
	uint8_t *src_data[4], int src_stride[4], int pix_fmt, int width, int height)
{
    int i;

    if (pix_fmt != AV_PIX_FMT_YUV420P &&
        pix_fmt != AV_PIX_FMT_YUV422P &&
        pix_fmt != AV_PIX_FMT_YUYV422 &&
        pix_fmt != AV_PIX_FMT_YUV444P &&
        pix_fmt != AV_PIX_FMT_YUV411P)
        return -1;
    if ((width & 3) != 0 || (height & 3) != 0)
        return -1;

	if ( pix_fmt != AV_PIX_FMT_YUYV422 )
	{
      for(i=0;i<3;i++) {
          if (i == 1) {
              switch(pix_fmt) {
              case AV_PIX_FMT_YUV420P:
                  width >>= 1;
                  height >>= 1;
                  break;
              case AV_PIX_FMT_YUV422P:
                  width >>= 1;
                  break;
              case AV_PIX_FMT_YUV411P:
                  width >>= 2;
                  break;
              default:
                  break;
              }
          }
          if (src_data[0] == dst_data[0]) {
              deinterlace_bottom_field_inplace(dst_data[i], dst_stride[i],
                                   width, height);
          } else {
              deinterlace_bottom_field(dst_data[i], dst_stride[i],
                                          src_data[i], src_stride[i],
                                          width, height);
          }
	  }
    }
	else {
      if (src_data[0] == dst_data[0]) {