]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/blobdiff - libavcodec/dv.c
Add a chroma_sample_location field to define positioning of chroma samples
[frescor/ffmpeg.git] / libavcodec / dv.c
index 8576838b7ad0cae2b419d3f5915aca13d6cb4040..774b0a73cbc94aac7edac103d5b77c00b1e962b9 100644 (file)
@@ -40,7 +40,8 @@
 #define ALT_BITSTREAM_READER
 #include "avcodec.h"
 #include "dsputil.h"
-#include "bitstream.h"
+#include "get_bits.h"
+#include "put_bits.h"
 #include "simple_idct.h"
 #include "dvdata.h"
 
@@ -392,6 +393,7 @@ static av_cold int dvvideo_init(AVCodecContext *avctx)
 
     avctx->coded_frame = &s->picture;
     s->avctx = avctx;
+    avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
 
     return 0;
 }
@@ -816,8 +818,9 @@ static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data,
                      s->ildct_cmp(NULL, data + linesize, NULL, linesize<<1, 4);
             return (ps > is);
         }
-    } else
-        return 0;
+    }
+
+    return 0;
 }
 
 static av_always_inline int dv_init_enc_block(EncBlockInfo* bi, uint8_t *data, int linesize, DVVideoContext *s, int bias)
@@ -1110,8 +1113,10 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
    144000 bytes for PAL - or twice those for 50Mbps) */
 static int dvvideo_decode_frame(AVCodecContext *avctx,
                                  void *data, int *data_size,
-                                 const uint8_t *buf, int buf_size)
+                                 AVPacket *avpkt)
 {
+    const uint8_t *buf = avpkt->data;
+    int buf_size = avpkt->size;
     DVVideoContext *s = avctx->priv_data;
 
     s->sys = dv_frame_profile(buf);