]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/utvideodec.c
avformat/mux: factorize interleaved write_packet
[ffmpeg] / libavcodec / utvideodec.c
index 3891df3570158f23e99c3b4eecf3468b3f4185dc..4da257fc6186027565716a8e8d05bced1a17dd35 100644 (file)
@@ -258,11 +258,11 @@ static int decode_plane(UtvideoContext *c, int plane_no,
             GetBitContext cbit, pbit;
             uint8_t *dest, *p;
 
-            ret = init_get_bits8(&cbit, c->control_stream[plane_no][slice], c->control_stream_size[plane_no][slice]);
+            ret = init_get_bits8_le(&cbit, c->control_stream[plane_no][slice], c->control_stream_size[plane_no][slice]);
             if (ret < 0)
                 return ret;
 
-            ret = init_get_bits8(&pbit, c->packed_stream[plane_no][slice], c->packed_stream_size[plane_no][slice]);
+            ret = init_get_bits8_le(&pbit, c->packed_stream[plane_no][slice], c->packed_stream_size[plane_no][slice]);
             if (ret < 0)
                 return ret;
 
@@ -890,6 +890,15 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
             }
         }
         break;
+    case AV_PIX_FMT_YUV420P10:
+        for (i = 0; i < 3; i++) {
+            ret = decode_plane10(c, i, (uint16_t *)frame.f->data[i], frame.f->linesize[i] / 2,
+                                 avctx->width >> !!i, avctx->height >> !!i,
+                                 plane_start[i], plane_start[i + 1] - 1024, c->frame_pred == PRED_LEFT);
+            if (ret)
+                return ret;
+        }
+        break;
     case AV_PIX_FMT_YUV422P10:
         for (i = 0; i < 3; i++) {
             ret = decode_plane10(c, i, (uint16_t *)frame.f->data[i], frame.f->linesize[i] / 2,
@@ -948,6 +957,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
         avctx->pix_fmt = AV_PIX_FMT_YUV444P;
         avctx->colorspace = AVCOL_SPC_BT470BG;
         break;
+    case MKTAG('U', 'Q', 'Y', '0'):
+        c->planes      = 3;
+        c->pro         = 1;
+        avctx->pix_fmt = AV_PIX_FMT_YUV420P10;
+        break;
     case MKTAG('U', 'Q', 'Y', '2'):
         c->planes      = 3;
         c->pro         = 1;