Browse code

yadif: support 10bit YUV

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>

Luca Barbato authored on 2011/12/04 23:56:41
Showing 1 changed files
... ...
@@ -145,7 +145,7 @@ static void filter(AVFilterContext *ctx, AVFilterBufferRef *dstpic,
145 145
         int w = dstpic->video->w;
146 146
         int h = dstpic->video->h;
147 147
         int refs = yadif->cur->linesize[i];
148
-        int df = (yadif->csp->comp[i].depth_minus1+1) / 8;
148
+        int df = (yadif->csp->comp[i].depth_minus1 + 8) / 8;
149 149
 
150 150
         if (i == 1 || i == 2) {
151 151
         /* Why is this not part of the per-plane description thing? */
... ...
@@ -212,7 +212,7 @@ static void return_frame(AVFilterContext *ctx, int is_second)
212 212
 
213 213
     if (!yadif->csp)
214 214
         yadif->csp = &av_pix_fmt_descriptors[link->format];
215
-    if (yadif->csp->comp[0].depth_minus1 == 15)
215
+    if (yadif->csp->comp[0].depth_minus1 / 8 == 1)
216 216
         yadif->filter_line = filter_line_c_16bit;
217 217
 
218 218
     filter(ctx, yadif->out, tff ^ !is_second, tff);
... ...
@@ -354,6 +354,9 @@ static int query_formats(AVFilterContext *ctx)
354 354
         AV_NE( PIX_FMT_GRAY16BE, PIX_FMT_GRAY16LE ),
355 355
         PIX_FMT_YUV440P,
356 356
         PIX_FMT_YUVJ440P,
357
+        AV_NE( PIX_FMT_YUV420P10BE, PIX_FMT_YUV420P10LE ),
358
+        AV_NE( PIX_FMT_YUV422P10BE, PIX_FMT_YUV422P10LE ),
359
+        AV_NE( PIX_FMT_YUV444P10BE, PIX_FMT_YUV444P10LE ),
357 360
         AV_NE( PIX_FMT_YUV420P16BE, PIX_FMT_YUV420P16LE ),
358 361
         AV_NE( PIX_FMT_YUV422P16BE, PIX_FMT_YUV422P16LE ),
359 362
         AV_NE( PIX_FMT_YUV444P16BE, PIX_FMT_YUV444P16LE ),