@@ -92,7 +92,7 @@ int ff_flv_decode_picture_header(H263DecContext *h)
s->h263_plus = 0;
- s->h263_long_vectors = 0;
+ h->long_vectors = 0;
/* PEI */
if (skip_1stop_8data_bits(&s->gb) < 0)
@@ -44,6 +44,7 @@ typedef struct H263DecContext {
MPVMainDecContext m;
int (*decode_mb)(MPVDecContext *s, int16_t block[12][64]); // used to avoid a switch
+ int long_vectors; ///< use horrible H.263v1 long vector mode
} H263DecContext;
int ff_h263_decode_motion(MPVDecContext *s, int pred, int f_code);
@@ -62,7 +62,7 @@ int ff_intel_h263_decode_picture_header(H263DecContext *h)
s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
- s->h263_long_vectors = get_bits1(&s->gb);
+ h->long_vectors = get_bits1(&s->gb);
if (get_bits1(&s->gb) != 0) {
av_log(s->avctx, AV_LOG_ERROR, "SAC not supported\n");
@@ -82,7 +82,7 @@ void ff_h263_show_pict_info(H263DecContext *h)
s->gb.size_in_bits, 1-s->no_rounding,
s->obmc ? " AP" : "",
s->umvplus ? " UMV" : "",
- s->h263_long_vectors ? " LONG" : "",
+ h->long_vectors ? " LONG" : "",
s->h263_plus ? " +" : "",
s->h263_aic ? " AIC" : "",
s->alt_inter_vlc ? " AIV" : "",
@@ -272,6 +272,9 @@ int ff_h263_resync(MPVMainDecContext *m)
int ff_h263_decode_motion(MPVDecContext *s, int pred, int f_code)
{
+ /* The following is only allowed because no h263dec-based
+ * decoder uses slice-threading. */
+ const H263DecContext *const h = (H263DecContext*)s;
int code, val, sign, shift;
code = get_vlc2(&s->gb, ff_h263_mv_vlc.table, H263_MV_VLC_BITS, 2);
@@ -293,7 +296,7 @@ int ff_h263_decode_motion(MPVDecContext *s, int pred, int f_code)
val += pred;
/* modulo decoding */
- if (!s->h263_long_vectors) {
+ if (!h->long_vectors) {
val = sign_extend(val, 5 + f_code);
} else {
/* horrible H.263 long vector mode */
@@ -1150,7 +1153,7 @@ int ff_h263_decode_picture_header(H263DecContext *h)
s->pict_type = AV_PICTURE_TYPE_I + get_bits1(&s->gb);
- s->h263_long_vectors = get_bits1(&s->gb);
+ h->long_vectors = get_bits1(&s->gb);
if (get_bits1(&s->gb) != 0) {
av_log(s->avctx, AV_LOG_ERROR, "H.263 SAC not supported\n");
@@ -177,7 +177,6 @@ typedef struct MPVContext {
/* motion compensation */
int unrestricted_mv; ///< mv can point outside of the coded picture
- int h263_long_vectors; ///< use horrible H.263v1 long vector mode
BlockDSPContext bdsp;
FDCTDSPContext fdsp;
@@ -390,7 +390,7 @@ static av_cold int rv10_decode_init(AVCodecContext *avctx)
rv->orig_height =
s->height = avctx->coded_height;
- s->h263_long_vectors = ((uint8_t *) avctx->extradata)[3] & 1;
+ h->long_vectors = avctx->extradata[3] & 1;
rv->sub_id = AV_RB32((uint8_t *) avctx->extradata + 4);
major_ver = RV_GET_MAJOR_VER(rv->sub_id);
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> --- libavcodec/flvdec.c | 2 +- libavcodec/h263dec.h | 1 + libavcodec/intelh263dec.c | 2 +- libavcodec/ituh263dec.c | 9 ++++++--- libavcodec/mpegvideo.h | 1 - libavcodec/rv10.c | 2 +- 6 files changed, 10 insertions(+), 7 deletions(-)