Merge commit '9cacdabd1c8cd257a942d8289349c37d992989b7'

* commit '9cacdabd1c8cd257a942d8289349c37d992989b7':
  jpegls: cosmetics: Drop some unnecessary parentheses
  mpegvideo: Remove commented-out PARANOID debug cruft

Conflicts:
	libavcodec/jpegls.c
	libavcodec/mpegvideo.c
	libavcodec/x86/mpegvideo.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-05-16 09:19:11 +02:00
commit 0d83b5722e
5 changed files with 10 additions and 33 deletions

View File

@ -31,16 +31,16 @@ void ff_jpegls_init_state(JLSState *state){
int i;
state->twonear = state->near * 2 + 1;
state->range = ((state->maxval + state->twonear - 1) / state->twonear) + 1;
state->range = (state->maxval + state->twonear - 1) / state->twonear + 1;
// QBPP = ceil(log2(RANGE))
for(state->qbpp = 0; (1 << state->qbpp) < state->range; state->qbpp++);
state->bpp = FFMAX(av_log2(state->maxval)+1, 2);
state->bpp = FFMAX(av_log2(state->maxval) + 1, 2);
state->limit = 2*(state->bpp + FFMAX(state->bpp, 8)) - state->qbpp;
for(i = 0; i < 367; i++) {
state->A[i] = FFMAX((state->range + 32) >> 6, 2);
state->A[i] = FFMAX(state->range + 32 >> 6, 2);
state->N[i] = 1;
}
@ -63,7 +63,7 @@ void ff_jpegls_reset_coding_parameters(JLSState *s, int reset_all){
if(s->maxval==0 || reset_all) s->maxval= (1 << s->bpp) - 1;
if(s->maxval >=128){
factor= (FFMIN(s->maxval, 4095) + 128)>>8;
factor = FFMIN(s->maxval, 4095) + 128 >> 8;
if(s->T1==0 || reset_all)
s->T1= iso_clip(factor*(basic_t1-2) + 2 + 3*s->near, s->near+1, s->maxval);

View File

@ -98,7 +98,7 @@ static inline int ls_get_code_regular(GetBitContext *gb, JLSState *state, int Q)
/* decode mapped error */
if(ret & 1)
ret = -((ret + 1) >> 1);
ret = -(ret + 1 >> 1);
else
ret >>= 1;
@ -136,7 +136,7 @@ static inline int ls_get_code_runterm(GetBitContext *gb, JLSState *state, int RI
ret += RItype + map;
if(ret & 1){
ret = map - ((ret + 1) >> 1);
ret = map - (ret + 1 >> 1);
state->B[Q]++;
} else {
ret = ret >> 1;
@ -186,7 +186,7 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s, void *
x += stride;
}
/* if EOL reached, we stop decoding */
if(r != (1 << ff_log2_run[state->run_index[comp]]))
if (r != 1 << ff_log2_run[state->run_index[comp]])
return;
if(state->run_index[comp] < 31)
state->run_index[comp]++;

View File

@ -49,7 +49,7 @@ static inline void ls_encode_regular(JLSState *state, PutBitContext *pb, int Q,
if(err < 0)
err += state->range;
if(err >= ((state->range + 1) >> 1)) {
if (err >= (state->range + 1 >> 1)) {
err -= state->range;
val = 2 * FFABS(err) - 1 - map;
} else
@ -145,7 +145,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
if(x >= w)
return;
Rb = R(last, x);
RItype = (FFABS(Ra - Rb) <= state->near);
RItype = FFABS(Ra - Rb) <= state->near;
pred = RItype ? Ra : Rb;
err = R(cur, x) - pred;
@ -166,7 +166,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
}
if(err < 0)
err += state->range;
if(err >= ((state->range + 1) >> 1))
if (err >= state->range + 1 >> 1)
err -= state->range;
ls_encode_runterm(state, pb, RItype, err, ff_log2_run[state->run_index[comp]]);

View File

@ -60,7 +60,6 @@ static void dct_unquantize_h263_intra_c(MpegEncContext *s,
static void dct_unquantize_h263_inter_c(MpegEncContext *s,
int16_t *block, int n, int qscale);
//#define DEBUG

View File

@ -164,28 +164,6 @@ __asm__ volatile(
);
}
/*
We can suppose that result of two multiplications can't be greater than 0xFFFF
i.e. is 16-bit, so we use here only PMULLW instruction and can avoid
a complex multiplication.
=====================================================
Full formula for multiplication of 2 integer numbers
which are represent as high:low words:
input: value1 = high1:low1
value2 = high2:low2
output: value3 = value1*value2
value3=high3:low3 (on overflow: modulus 2^32 wrap-around)
this mean that for 0x123456 * 0x123456 correct result is 0x766cb0ce4
but this algorithm will compute only 0x66cb0ce4
this limited by 16-bit size of operands
---------------------------------
tlow1 = high1*low2
tlow2 = high2*low1
tlow1 = tlow1 + tlow2
high3:low3 = low1*low2
high3 += tlow1
*/
static void dct_unquantize_mpeg1_intra_mmx(MpegEncContext *s,
int16_t *block, int n, int qscale)
{