]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cavsdec.c
fft-test: add option to set cpuflag mask
[ffmpeg] / libavcodec / cavsdec.c
index 88034068ff90f0eaf509ea4037c316844847615a..9f91d0b8cac13bbf5b7e1b0b3fe119ac1a362955 100644 (file)
@@ -469,7 +469,7 @@ static int decode_pic(AVSContext *h) {
 
     if (!s->context_initialized) {
         s->avctx->idct_algo = FF_IDCT_CAVS;
-        if (MPV_common_init(s) < 0)
+        if (ff_MPV_common_init(s) < 0)
             return -1;
         ff_init_scantable(s->dsp.idct_permutation,&h->scantable,ff_zigzag_direct);
     }
@@ -490,7 +490,7 @@ static int decode_pic(AVSContext *h) {
             skip_bits(&s->gb,24);//time_code
         /* old sample clips were all progressive and no low_delay,
            bump stream revision if detected otherwise */
-        if((s->low_delay) || !(show_bits(&s->gb,9) & 1))
+        if (s->low_delay || !(show_bits(&s->gb,9) & 1))
             h->stream_revision = 1;
         /* similarly test top_field_first and repeat_first_field */
         else if(show_bits(&s->gb,11) & 3)
@@ -500,9 +500,9 @@ static int decode_pic(AVSContext *h) {
     }
     /* release last B frame */
     if(h->picture.f.data[0])
-        s->avctx->release_buffer(s->avctx, (AVFrame *)&h->picture);
+        s->avctx->release_buffer(s->avctx, &h->picture.f);
 
-    s->avctx->get_buffer(s->avctx, (AVFrame *)&h->picture);
+    s->avctx->get_buffer(s->avctx, &h->picture.f);
     ff_cavs_init_pic(h);
     h->picture.poc = get_bits(&s->gb,8)*2;
 
@@ -591,7 +591,7 @@ static int decode_pic(AVSContext *h) {
     }
     if(h->pic_type != AV_PICTURE_TYPE_B) {
         if(h->DPB[1].f.data[0])
-            s->avctx->release_buffer(s->avctx, (AVFrame *)&h->DPB[1]);
+            s->avctx->release_buffer(s->avctx, &h->DPB[1].f);
         h->DPB[1] = h->DPB[0];
         h->DPB[0] = h->picture;
         memset(&h->picture,0,sizeof(Picture));
@@ -624,8 +624,8 @@ static int decode_seq_header(AVSContext *h) {
     s->low_delay =       get_bits1(&s->gb);
     h->mb_width  = (s->width  + 15) >> 4;
     h->mb_height = (s->height + 15) >> 4;
-    h->s.avctx->time_base.den = ff_frame_rate_tab[frame_rate_code].num;
-    h->s.avctx->time_base.num = ff_frame_rate_tab[frame_rate_code].den;
+    h->s.avctx->time_base.den = avpriv_frame_rate_tab[frame_rate_code].num;
+    h->s.avctx->time_base.num = avpriv_frame_rate_tab[frame_rate_code].den;
     h->s.avctx->width  = s->width;
     h->s.avctx->height = s->height;
     if(!h->top_qp)
@@ -655,7 +655,8 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
     if (buf_size == 0) {
         if (!s->low_delay && h->DPB[0].f.data[0]) {
             *data_size = sizeof(AVPicture);
-            *picture = *(AVFrame *) &h->DPB[0];
+            *picture = h->DPB[0].f;
+            memset(&h->DPB[0], 0, sizeof(h->DPB[0]));
         }
         return 0;
     }
@@ -663,7 +664,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
     buf_ptr = buf;
     buf_end = buf + buf_size;
     for(;;) {
-        buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc);
+        buf_ptr = avpriv_mpv_find_start_code(buf_ptr,buf_end, &stc);
         if((stc & 0xFFFFFE00) || buf_ptr == buf_end)
             return FFMAX(0, buf_ptr - buf - s->parse_context.last_index);
         input_size = (buf_end - buf_ptr)*8;
@@ -675,9 +676,9 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
         case PIC_I_START_CODE:
             if(!h->got_keyframe) {
                 if(h->DPB[0].f.data[0])
-                    avctx->release_buffer(avctx, (AVFrame *)&h->DPB[0]);
+                    avctx->release_buffer(avctx, &h->DPB[0].f);
                 if(h->DPB[1].f.data[0])
-                    avctx->release_buffer(avctx, (AVFrame *)&h->DPB[1]);
+                    avctx->release_buffer(avctx, &h->DPB[1].f);
                 h->got_keyframe = 1;
             }
         case PIC_PB_START_CODE:
@@ -691,12 +692,12 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
             *data_size = sizeof(AVPicture);
             if(h->pic_type != AV_PICTURE_TYPE_B) {
                 if(h->DPB[1].f.data[0]) {
-                    *picture = *(AVFrame *) &h->DPB[1];
+                    *picture = h->DPB[1].f;
                 } else {
                     *data_size = 0;
                 }
             } else
-                *picture = *(AVFrame *) &h->picture;
+                *picture = h->picture.f;
             break;
         case EXT_START_CODE:
             //mpeg_decode_extension(avctx,buf_ptr, input_size);
@@ -723,6 +724,6 @@ AVCodec ff_cavs_decoder = {
     .close          = ff_cavs_end,
     .decode         = cavs_decode_frame,
     .capabilities   = CODEC_CAP_DR1 | CODEC_CAP_DELAY,
-    .flush= cavs_flush,
-    .long_name= NULL_IF_CONFIG_SMALL("Chinese AVS video (AVS1-P2, JiZhun profile)"),
+    .flush          = cavs_flush,
+    .long_name      = NULL_IF_CONFIG_SMALL("Chinese AVS video (AVS1-P2, JiZhun profile)"),
 };