]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/rv40.c
configure: Check for -no_weak_imports in ldflags on macOS
[ffmpeg] / libavcodec / rv40.c
index e5b18218694e4a8c64b169c3d84219e312003ad3..d46a44a5dd73da9014689ddd6269fbd690eebfef 100644 (file)
@@ -27,9 +27,9 @@
 #include "libavutil/imgutils.h"
 
 #include "avcodec.h"
+#include "golomb_legacy.h"
 #include "mpegutils.h"
 #include "mpegvideo.h"
-#include "golomb.h"
 
 #include "rv34.h"
 #include "rv40vlc2.h"
@@ -130,22 +130,23 @@ static int rv40_parse_slice_header(RV34DecContext *r, GetBitContext *gb, SliceIn
     int mb_bits;
     int w = r->s.width, h = r->s.height;
     int mb_size;
+    int ret;
 
     memset(si, 0, sizeof(SliceInfo));
     if(get_bits1(gb))
-        return -1;
+        return AVERROR_INVALIDDATA;
     si->type = get_bits(gb, 2);
     if(si->type == 1) si->type = 0;
     si->quant = get_bits(gb, 5);
     if(get_bits(gb, 2))
-        return -1;
+        return AVERROR_INVALIDDATA;
     si->vlc_set = get_bits(gb, 2);
     skip_bits1(gb);
     si->pts = get_bits(gb, 13);
     if(!si->type || !get_bits1(gb))
         rv40_parse_picture_size(gb, &w, &h);
-    if(av_image_check_size(w, h, 0, r->s.avctx) < 0)
-        return -1;
+    if ((ret = av_image_check_size(w, h, 0, r->s.avctx)) < 0)
+        return ret;
     si->width  = w;
     si->height = h;
     mb_size = ((w + 15) >> 4) * ((h + 15) >> 4);
@@ -230,7 +231,7 @@ static int rv40_decode_mb_info(RV34DecContext *r)
     int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
 
     if(!r->s.mb_skip_run)
-        r->s.mb_skip_run = svq3_get_ue_golomb(gb) + 1;
+        r->s.mb_skip_run = get_interleaved_ue_golomb(gb) + 1;
 
     if(--r->s.mb_skip_run)
          return RV34_MB_SKIP;
@@ -453,7 +454,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row)
         }
 
         for(j = 0; j < 16; j += 4){
-            Y = s->current_picture_ptr->f.data[0] + mb_x*16 + (row*16 + j) * s->linesize;
+            Y = s->current_picture_ptr->f->data[0] + mb_x*16 + (row*16 + j) * s->linesize;
             for(i = 0; i < 4; i++, Y += 4){
                 int ij = i + j;
                 int clip_cur = y_to_deblock & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
@@ -498,7 +499,7 @@ static void rv40_loop_filter(RV34DecContext *r, int row)
         }
         for(k = 0; k < 2; k++){
             for(j = 0; j < 2; j++){
-                C = s->current_picture_ptr->f.data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize;
+                C = s->current_picture_ptr->f->data[k + 1] + mb_x*8 + (row*8 + j*4) * s->uvlinesize;
                 for(i = 0; i < 2; i++, C += 4){
                     int ij = i + j*2;
                     int clip_cur = c_to_deblock[k] & (MASK_CUR << ij) ? clip[POS_CUR] : 0;
@@ -570,8 +571,8 @@ AVCodec ff_rv40_decoder = {
     .init                  = rv40_decode_init,
     .close                 = ff_rv34_decode_end,
     .decode                = ff_rv34_decode_frame,
-    .capabilities          = CODEC_CAP_DR1 | CODEC_CAP_DELAY |
-                             CODEC_CAP_FRAME_THREADS,
+    .capabilities          = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY |
+                             AV_CODEC_CAP_FRAME_THREADS,
     .flush                 = ff_mpeg_flush,
     .pix_fmts              = (const enum AVPixelFormat[]) {
         AV_PIX_FMT_YUV420P,