]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dv.c
vmdvideo: use the AVFrame API properly.
[ffmpeg] / libavcodec / dv.c
index 91588192aec995f35e29d4d1096b97bddaa4a355..4f1a149e7ded0ef845adb4aab23fbcf7fe192e9d 100644 (file)
@@ -47,6 +47,7 @@
 #include "simple_idct.h"
 #include "dvdata.h"
 #include "dv_tablegen.h"
+#include "dv.h"
 
 /* XXX: also include quantization */
 RL_VLC_ELEM ff_dv_rl_vlc[1184];
@@ -313,6 +314,7 @@ av_cold int ff_dvvideo_init(AVCodecContext *avctx)
     s->idct_put[1] = ff_simple_idct248_put;  // FIXME: need to add it to DSP
     memcpy(s->dv_zigzag[1], ff_zigzag248_direct, 64);
 
+    avcodec_get_frame_defaults(&s->picture);
     avctx->coded_frame = &s->picture;
     s->avctx = avctx;
     avctx->chroma_sample_location = AVCHROMA_LOC_TOPLEFT;
@@ -339,11 +341,6 @@ static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
 static const int vs_total_ac_bits = (100 * 4 + 68*2) * 5;
 static const int mb_area_start[5] = { 1, 6, 21, 43, 64 };
 
-static inline int put_bits_left(PutBitContext* s)
-{
-    return (s->buf_end - s->buf) * 8 - put_bits_count(s);
-}
-
 #if CONFIG_SMALL
 /* Converts run and level (where level != 0) pair into VLC, returning bit size */
 static av_always_inline int dv_rl2vlc(int run, int level, int sign, uint32_t* vlc)
@@ -978,6 +975,7 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
 
 AVCodec ff_dvvideo_encoder = {
     .name           = "dvvideo",
+    .long_name      = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_DVVIDEO,
     .priv_data_size = sizeof(DVVideoContext),
@@ -987,6 +985,5 @@ AVCodec ff_dvvideo_encoder = {
     .pix_fmts       = (const enum AVPixelFormat[]) {
         AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE
     },
-    .long_name      = NULL_IF_CONFIG_SMALL("DV (Digital Video)"),
 };
 #endif // CONFIG_DVVIDEO_ENCODER