aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/svq3.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-12-08 16:36:47 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-12-08 16:36:47 +0100
commit5c076205a67d44c9e28ce5a74b55d281d1a3c106 (patch)
tree56824e88a7c7a208864a04ec3a4659d5e7fd1bcb /libavcodec/svq3.c
parent1a4250493b3aae4ca366092fb0922e7c098f478c (diff)
parent9a2e79116d6235c53d8e9663a8d30d1950d7431a (diff)
downloadandroid_external_ffmpeg-5c076205a67d44c9e28ce5a74b55d281d1a3c106.tar.gz
android_external_ffmpeg-5c076205a67d44c9e28ce5a74b55d281d1a3c106.tar.bz2
android_external_ffmpeg-5c076205a67d44c9e28ce5a74b55d281d1a3c106.zip
Merge remote-tracking branch 'qatar/master'
* qatar/master: golomb: use unsigned arithmetics in svq3_get_ue_golomb() x86: float_dsp: fix loading of the len parameter on x86-32 takdec: fix initialisation of LOCAL_ALIGNED array takdec: fix initialisation of LOCAL_ALIGNED array Conflicts: libavcodec/rv30.c libavcodec/svq3.c libavcodec/takdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/svq3.c')
-rw-r--r--libavcodec/svq3.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index c50efbc70f..45b96e4a30 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -218,17 +218,18 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
static const uint8_t *const scan_patterns[4] =
{ luma_dc_zigzag_scan, zigzag_scan, svq3_scan, chroma_dc_scan };
- int run, level, sign, vlc, limit;
+ int run, level, sign, limit;
+ unsigned vlc;
const int intra = 3 * type >> 2;
const uint8_t *const scan = scan_patterns[type];
for (limit = (16 >> intra); index < 16; index = limit, limit += 8) {
for (; (vlc = svq3_get_ue_golomb(gb)) != 0; index++) {
- if (vlc < 0)
+ if ((int)vlc < 0)
return -1;
- sign = (vlc & 0x1) - 1;
- vlc = vlc + 1 >> 1;
+ sign = (vlc & 1) ? 0 : -1;
+ vlc = vlc + 1 >> 1;
if (type == 3) {
if (vlc < 3) {
@@ -1014,7 +1015,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
H264Context *h = &svq3->h;
MpegEncContext *s = &h->s;
int buf_size = avpkt->size;
- int m, mb_type, left;
+ int m, left;
uint8_t *buf;
/* special case for last picture */
@@ -1109,6 +1110,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
for (s->mb_y = 0; s->mb_y < s->mb_height; s->mb_y++) {
for (s->mb_x = 0; s->mb_x < s->mb_width; s->mb_x++) {
+ unsigned mb_type;
h->mb_xy = s->mb_x + s->mb_y * s->mb_stride;
if ((get_bits_count(&s->gb) + 7) >= s->gb.size_in_bits &&
@@ -1129,7 +1131,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
mb_type += 8;
else if (s->pict_type == AV_PICTURE_TYPE_B && mb_type >= 4)
mb_type += 4;
- if ((unsigned)mb_type > 33 || svq3_decode_mb(svq3, mb_type)) {
+ if (mb_type > 33 || svq3_decode_mb(svq3, mb_type)) {
av_log(h->s.avctx, AV_LOG_ERROR,
"error while decoding MB %d %d\n", s->mb_x, s->mb_y);
return -1;