]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cavsdec.c
More okayed chunks of AAC encoder
[ffmpeg] / libavcodec / cavsdec.c
index d03a79b4a4171b171965020deb499a17e7ab79d0..a978fe1a1a92f916b75ba8047a40e6f0e5c6a4c8 100644 (file)
@@ -116,8 +116,8 @@ static int decode_residual_block(AVSContext *h, GetBitContext *gb,
                                  const dec_2dvlc_t *r, int esc_golomb_order,
                                  int qp, uint8_t *dst, int stride) {
     int i, level_code, esc_code, level, run, mask;
-    DCTELEM level_buf[64];
-    uint8_t run_buf[64];
+    DCTELEM level_buf[65];
+    uint8_t run_buf[65];
     DCTELEM *block = h->block;
 
     for(i=0;i<65;i++) {
@@ -432,7 +432,7 @@ static inline void check_for_slice(AVSContext *h) {
     int align;
     align = (-get_bits_count(gb)) & 7;
     if((show_bits_long(gb,24+align) & 0xFFFFFF) == 0x000001) {
-        get_bits_long(gb,24+align);
+        skip_bits_long(gb,24+align);
         h->stc = get_bits(gb,8);
         decode_slice_header(h,gb);
     }
@@ -455,7 +455,7 @@ static int decode_pic(AVSContext *h) {
             return -1;
         ff_init_scantable(s->dsp.idct_permutation,&h->scantable,ff_zigzag_direct);
     }
-    get_bits(&s->gb,16);//bbv_dwlay
+    skip_bits(&s->gb,16);//bbv_dwlay
     if(h->stc == PIC_PB_START_CODE) {
         h->pic_type = get_bits(&s->gb,2) + FF_I_TYPE;
         if(h->pic_type > FF_B_TYPE) {
@@ -469,7 +469,7 @@ static int decode_pic(AVSContext *h) {
     } else {
         h->pic_type = FF_I_TYPE;
         if(get_bits1(&s->gb))
-            get_bits(&s->gb,16);//time_code
+            skip_bits(&s->gb,16);//time_code
     }
     /* release last B frame */
     if(h->picture.data[0])
@@ -501,7 +501,7 @@ static int decode_pic(AVSContext *h) {
     if(h->progressive)
         h->pic_structure = 1;
     else if(!(h->pic_structure = get_bits1(&s->gb) && (h->stc == PIC_PB_START_CODE)) )
-        get_bits1(&s->gb);     //advanced_pred_mode_disable
+        skip_bits1(&s->gb);     //advanced_pred_mode_disable
     skip_bits1(&s->gb);        //top_field_first
     skip_bits1(&s->gb);        //repeat_first_field
     h->qp_fixed                = get_bits1(&s->gb);
@@ -614,14 +614,14 @@ static void cavs_flush(AVCodecContext * avctx) {
 }
 
 static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size,
-                             uint8_t * buf, int buf_size) {
+                             const uint8_t * buf, int buf_size) {
     AVSContext *h = avctx->priv_data;
     MpegEncContext *s = &h->s;
     int input_size;
     const uint8_t *buf_end;
     const uint8_t *buf_ptr;
     AVFrame *picture = data;
-    uint32_t stc;
+    uint32_t stc = -1;
 
     s->avctx = avctx;
 
@@ -699,4 +699,5 @@ AVCodec cavs_decoder = {
     cavs_decode_frame,
     CODEC_CAP_DR1 | CODEC_CAP_DELAY,
     .flush= cavs_flush,
+    .long_name= NULL_IF_CONFIG_SMALL("Chinese AVS video (AVS1-P2, JiZhun profile)"),
 };