summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/h264.h3
-rw-r--r--libavcodec/h264_cavlc.c8
-rw-r--r--libavcodec/h264_slice.c4
-rw-r--r--libavcodec/svq3.c4
4 files changed, 10 insertions, 9 deletions
diff --git a/libavcodec/h264.h b/libavcodec/h264.h
index ba1eaff649..c6b5ab207e 100644
--- a/libavcodec/h264.h
+++ b/libavcodec/h264.h
@@ -393,6 +393,8 @@ typedef struct H264SliceContext {
ptrdiff_t mb_linesize; ///< may be equal to s->linesize or s->linesize * 2, for mbaff
ptrdiff_t mb_uvlinesize;
+ int mb_skip_run;
+
int redundant_pic_count;
/**
@@ -568,7 +570,6 @@ typedef struct H264Context {
int mb_x, mb_y;
int resync_mb_x;
int resync_mb_y;
- int mb_skip_run;
int mb_height, mb_width;
int mb_stride;
int mb_num;
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c
index ab60f83baa..a0e3a725ba 100644
--- a/libavcodec/h264_cavlc.c
+++ b/libavcodec/h264_cavlc.c
@@ -717,12 +717,12 @@ int ff_h264_decode_mb_cavlc(H264Context *h, H264SliceContext *sl)
cbp = 0; /* avoid warning. FIXME: find a solution without slowing
down the code */
if (sl->slice_type_nos != AV_PICTURE_TYPE_I) {
- if(h->mb_skip_run==-1)
- h->mb_skip_run= get_ue_golomb_long(&h->gb);
+ if (sl->mb_skip_run == -1)
+ sl->mb_skip_run = get_ue_golomb_long(&h->gb);
- if (h->mb_skip_run--) {
+ if (sl->mb_skip_run--) {
if(FRAME_MBAFF(h) && (h->mb_y&1) == 0){
- if(h->mb_skip_run==0)
+ if (sl->mb_skip_run == 0)
h->mb_mbaff = h->mb_field_decoding_flag = get_bits1(&h->gb);
}
decode_mb_skip(h, sl);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 9591bea08e..71a55336d9 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -2400,7 +2400,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
H264Context *h = sl->h264;
int lf_x_start = h->mb_x;
- h->mb_skip_run = -1;
+ sl->mb_skip_run = -1;
av_assert0(h->block_offset[15] == (4 * ((scan8[15] - scan8[0]) & 7) << h->pixel_shift) + 4 * h->linesize * ((scan8[15] - scan8[0]) >> 3));
@@ -2546,7 +2546,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
}
}
- if (get_bits_left(&h->gb) <= 0 && h->mb_skip_run <= 0) {
+ if (get_bits_left(&h->gb) <= 0 && sl->mb_skip_run <= 0) {
tprintf(h->avctx, "slice end %d %d\n",
get_bits_count(&h->gb), h->gb.size_in_bits);
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 992c100051..009fe13cd5 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -828,11 +828,11 @@ static int svq3_decode_slice_header(AVCodecContext *avctx)
if ((header & 0x9F) == 2) {
i = (h->mb_num < 64) ? 6 : (1 + av_log2(h->mb_num - 1));
- h->mb_skip_run = get_bits(&h->gb, i) -
+ sl->mb_skip_run = get_bits(&h->gb, i) -
(h->mb_y * h->mb_width + h->mb_x);
} else {
skip_bits1(&h->gb);
- h->mb_skip_run = 0;
+ sl->mb_skip_run = 0;
}
sl->slice_num = get_bits(&h->gb, 8);