#include "avcodec.h"
#include "dsputil.h"
#include "mpegvideo.h"
-#include "mpegvideo_common.h"
#include "mpeg12.h"
#include "mpeg12data.h"
s->mb_x=0;
- if (avctx->hwaccel) {
- const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
- int start_code = -1;
- buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
- if (buf_end < *buf + buf_size)
- buf_end -= 4;
- s->mb_y = mb_y;
- if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
- return DECODE_SLICE_ERROR;
- *buf = buf_end;
- return DECODE_SLICE_OK;
- }
-
for(;;) {
int code = get_vlc2(&s->gb, mbincr_vlc.table, MBINCR_VLC_BITS, 2);
if (code < 0){
return -1;
}
+ if (avctx->hwaccel) {
+ const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */
+ int start_code = -1;
+ buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code);
+ if (buf_end < *buf + buf_size)
+ buf_end -= 4;
+ s->mb_y = mb_y;
+ if (avctx->hwaccel->decode_slice(avctx, buf_start, buf_end - buf_start) < 0)
+ return DECODE_SLICE_ERROR;
+ *buf = buf_end;
+ return DECODE_SLICE_OK;
+ }
+
s->resync_mb_x= s->mb_x;
s->resync_mb_y= s->mb_y= mb_y;
s->mb_skip_run= 0;
s->mb_y++;
if(s->mb_y<<field_pic >= s->mb_height){
- int left= s->gb.size_in_bits - get_bits_count(&s->gb);
+ int left= get_bits_left(&s->gb);
int is_d10= s->chroma_format==2 && s->pict_type==FF_I_TYPE && avctx->profile==0 && avctx->level==5
&& s->intra_dc_precision == 2 && s->q_scale_type == 1 && s->alternate_scan == 0
&& s->progressive_frame == 0 /* vbv_delay == 0xBBB || 0xE10*/;
if(avctx->thread_count > 1){
int i;
- avctx->execute(avctx, slice_decode_thread, (void**)&(s2->thread_context[0]), NULL, s->slice_count, sizeof(void*));
+ avctx->execute(avctx, slice_decode_thread, &s2->thread_context[0], NULL, s->slice_count, sizeof(void*));
for(i=0; i<s->slice_count; i++)
s2->error_count += s2->thread_context[i]->error_count;
}
/* Allocate a dummy frame */
i= ff_find_unused_picture(s2, 0);
s2->last_picture_ptr= &s2->picture[i];
- if(alloc_picture(s2, s2->last_picture_ptr, 0) < 0)
+ if(ff_alloc_picture(s2, s2->last_picture_ptr, 0) < 0)
return -1;
}
}