Commit 5c076205 authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 1a425049 9a2e7911
...@@ -107,7 +107,8 @@ static inline int get_ue_golomb_31(GetBitContext *gb){ ...@@ -107,7 +107,8 @@ static inline int get_ue_golomb_31(GetBitContext *gb){
return ff_ue_golomb_vlc_code[buf]; return ff_ue_golomb_vlc_code[buf];
} }
static inline int svq3_get_ue_golomb(GetBitContext *gb){ static inline unsigned svq3_get_ue_golomb(GetBitContext *gb)
{
uint32_t buf; uint32_t buf;
OPEN_READER(re, gb); OPEN_READER(re, gb);
...@@ -121,7 +122,7 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){ ...@@ -121,7 +122,7 @@ static inline int svq3_get_ue_golomb(GetBitContext *gb){
return ff_interleaved_ue_golomb_vlc_code[buf]; return ff_interleaved_ue_golomb_vlc_code[buf];
}else{ }else{
int ret = 1; unsigned ret = 1;
do { do {
buf >>= 32 - 8; buf >>= 32 - 8;
......
...@@ -78,8 +78,8 @@ static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t ...@@ -78,8 +78,8 @@ static int rv30_decode_intra_types(RV34DecContext *r, GetBitContext *gb, int8_t
for(i = 0; i < 4; i++, dst += r->intra_types_stride - 4){ for(i = 0; i < 4; i++, dst += r->intra_types_stride - 4){
for(j = 0; j < 4; j+= 2){ for(j = 0; j < 4; j+= 2){
int code = svq3_get_ue_golomb(gb) << 1; unsigned code = svq3_get_ue_golomb(gb) << 1;
if(code > 80U*2U){ if (code > 80U*2U) {
av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n"); av_log(r->s.avctx, AV_LOG_ERROR, "Incorrect intra prediction code\n");
return -1; return -1;
} }
...@@ -106,9 +106,9 @@ static int rv30_decode_mb_info(RV34DecContext *r) ...@@ -106,9 +106,9 @@ static int rv30_decode_mb_info(RV34DecContext *r)
static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 }; static const int rv30_b_types[6] = { RV34_MB_SKIP, RV34_MB_B_DIRECT, RV34_MB_B_FORWARD, RV34_MB_B_BACKWARD, RV34_MB_TYPE_INTRA, RV34_MB_TYPE_INTRA16x16 };
MpegEncContext *s = &r->s; MpegEncContext *s = &r->s;
GetBitContext *gb = &s->gb; GetBitContext *gb = &s->gb;
int code = svq3_get_ue_golomb(gb); unsigned code = svq3_get_ue_golomb(gb);
if(code > 11U){ if (code > 11) {
av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n"); av_log(s->avctx, AV_LOG_ERROR, "Incorrect MB type code\n");
return -1; return -1;
} }
......
...@@ -218,16 +218,17 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block, ...@@ -218,16 +218,17 @@ static inline int svq3_decode_block(GetBitContext *gb, DCTELEM *block,
static const uint8_t *const scan_patterns[4] = static const uint8_t *const scan_patterns[4] =
{ luma_dc_zigzag_scan, zigzag_scan, svq3_scan, chroma_dc_scan }; { 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 int intra = 3 * type >> 2;
const uint8_t *const scan = scan_patterns[type]; const uint8_t *const scan = scan_patterns[type];
for (limit = (16 >> intra); index < 16; index = limit, limit += 8) { for (limit = (16 >> intra); index < 16; index = limit, limit += 8) {
for (; (vlc = svq3_get_ue_golomb(gb)) != 0; index++) { for (; (vlc = svq3_get_ue_golomb(gb)) != 0; index++) {
if (vlc < 0) if ((int)vlc < 0)
return -1; return -1;
sign = (vlc & 0x1) - 1; sign = (vlc & 1) ? 0 : -1;
vlc = vlc + 1 >> 1; vlc = vlc + 1 >> 1;
if (type == 3) { if (type == 3) {
...@@ -1014,7 +1015,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, ...@@ -1014,7 +1015,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
H264Context *h = &svq3->h; H264Context *h = &svq3->h;
MpegEncContext *s = &h->s; MpegEncContext *s = &h->s;
int buf_size = avpkt->size; int buf_size = avpkt->size;
int m, mb_type, left; int m, left;
uint8_t *buf; uint8_t *buf;
/* special case for last picture */ /* special case for last picture */
...@@ -1109,6 +1110,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data, ...@@ -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_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++) { 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; h->mb_xy = s->mb_x + s->mb_y * s->mb_stride;
if ((get_bits_count(&s->gb) + 7) >= s->gb.size_in_bits && 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, ...@@ -1129,7 +1131,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
mb_type += 8; mb_type += 8;
else if (s->pict_type == AV_PICTURE_TYPE_B && mb_type >= 4) else if (s->pict_type == AV_PICTURE_TYPE_B && mb_type >= 4)
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, av_log(h->s.avctx, AV_LOG_ERROR,
"error while decoding MB %d %d\n", s->mb_x, s->mb_y); "error while decoding MB %d %d\n", s->mb_x, s->mb_y);
return -1; return -1;
......
...@@ -127,7 +127,10 @@ VECTOR_FMUL_SCALAR ...@@ -127,7 +127,10 @@ VECTOR_FMUL_SCALAR
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
%macro VECTOR_DMUL_SCALAR 0 %macro VECTOR_DMUL_SCALAR 0
%if UNIX64 %if ARCH_X86_32
cglobal vector_dmul_scalar, 3,4,3, dst, src, mul, len, lenaddr
mov lenq, lenaddrm
%elif UNIX64
cglobal vector_dmul_scalar, 3,3,3, dst, src, len cglobal vector_dmul_scalar, 3,3,3, dst, src, len
%else %else
cglobal vector_dmul_scalar, 4,4,3, dst, src, mul, len cglobal vector_dmul_scalar, 4,4,3, dst, src, mul, len
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment