]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dvenc.c
lavc: Add spherical packet side data API
[ffmpeg] / libavcodec / dvenc.c
index 3bbcaf09551417c95fe27e77ea1a90326dfa4950..399c4341f8404314c876599448440982ecd48c44 100644 (file)
@@ -27,6 +27,7 @@
 #include "config.h"
 
 #include "libavutil/attributes.h"
+#include "libavutil/internal.h"
 #include "libavutil/pixdesc.h"
 
 #include "avcodec.h"
@@ -35,6 +36,7 @@
 #include "dv_tablegen.h"
 #include "fdctdsp.h"
 #include "internal.h"
+#include "mathops.h"
 #include "me_cmp.h"
 #include "pixblockdsp.h"
 #include "put_bits.h"
@@ -195,9 +197,9 @@ static av_always_inline PutBitContext *dv_encode_ac(EncBlockInfo *bi,
 }
 
 static av_always_inline int dv_guess_dct_mode(DVVideoContext *s, uint8_t *data,
-                                              int linesize)
+                                              ptrdiff_t linesize)
 {
-    if (s->avctx->flags & CODEC_FLAG_INTERLACED_DCT) {
+    if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
         int ps = s->ildct_cmp(NULL, data, NULL, linesize, 8) - 400;
         if (ps > 0) {
             int is = s->ildct_cmp(NULL, data,            NULL, linesize << 1, 4) +
@@ -232,8 +234,8 @@ static const int dv_weight_248[64] = {
 };
 
 static av_always_inline int dv_init_enc_block(EncBlockInfo *bi, uint8_t *data,
-                                              int linesize, DVVideoContext *s,
-                                              int bias)
+                                              ptrdiff_t linesize,
+                                              DVVideoContext *s, int bias)
 {
     const int *weight;
     const uint8_t *zigzag_scan;
@@ -411,7 +413,8 @@ static int dv_encode_video_segment(AVCodecContext *avctx, void *arg)
     DVVideoContext *s = avctx->priv_data;
     DVwork_chunk *work_chunk = arg;
     int mb_index, i, j;
-    int mb_x, mb_y, c_offset, linesize, y_stride;
+    int mb_x, mb_y, c_offset;
+    ptrdiff_t linesize, y_stride;
     uint8_t *y_ptr;
     uint8_t *dif;
     LOCAL_ALIGNED_8(uint8_t, scratch, [128]);
@@ -716,8 +719,12 @@ static int dvvideo_encode_frame(AVCodecContext *c, AVPacket *pkt,
 
     c->pix_fmt                = s->sys->pix_fmt;
     s->frame                  = frame;
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
     c->coded_frame->key_frame = 1;
     c->coded_frame->pict_type = AV_PICTURE_TYPE_I;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
 
     s->buf = pkt->data;
     c->execute(c, dv_encode_video_segment, s->work_chunks, NULL,
@@ -741,7 +748,7 @@ AVCodec ff_dvvideo_encoder = {
     .priv_data_size = sizeof(DVVideoContext),
     .init           = dvvideo_encode_init,
     .encode2        = dvvideo_encode_frame,
-    .capabilities   = CODEC_CAP_SLICE_THREADS,
+    .capabilities   = AV_CODEC_CAP_SLICE_THREADS,
     .pix_fmts       = (const enum AVPixelFormat[]) {
         AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P,
         AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE