|
|
@ -47,6 +47,8 @@ static void dct_unquantize_mpeg1_inter_c(MpegEncContext *s, |
|
|
|
DCTELEM *block, int n, int qscale); |
|
|
|
DCTELEM *block, int n, int qscale); |
|
|
|
static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, |
|
|
|
static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, |
|
|
|
DCTELEM *block, int n, int qscale); |
|
|
|
DCTELEM *block, int n, int qscale); |
|
|
|
|
|
|
|
static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, |
|
|
|
|
|
|
|
DCTELEM *block, int n, int qscale); |
|
|
|
static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, |
|
|
|
static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, |
|
|
|
DCTELEM *block, int n, int qscale); |
|
|
|
DCTELEM *block, int n, int qscale); |
|
|
|
static void dct_unquantize_h263_intra_c(MpegEncContext *s, |
|
|
|
static void dct_unquantize_h263_intra_c(MpegEncContext *s, |
|
|
@ -266,6 +268,8 @@ int DCT_common_init(MpegEncContext *s) |
|
|
|
s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c; |
|
|
|
s->dct_unquantize_mpeg1_intra = dct_unquantize_mpeg1_intra_c; |
|
|
|
s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c; |
|
|
|
s->dct_unquantize_mpeg1_inter = dct_unquantize_mpeg1_inter_c; |
|
|
|
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c; |
|
|
|
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_c; |
|
|
|
|
|
|
|
if(s->flags & CODEC_FLAG_BITEXACT) |
|
|
|
|
|
|
|
s->dct_unquantize_mpeg2_intra = dct_unquantize_mpeg2_intra_bitexact; |
|
|
|
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c; |
|
|
|
s->dct_unquantize_mpeg2_inter = dct_unquantize_mpeg2_inter_c; |
|
|
|
|
|
|
|
|
|
|
|
#ifdef CONFIG_ENCODERS |
|
|
|
#ifdef CONFIG_ENCODERS |
|
|
@ -6527,6 +6531,39 @@ static void dct_unquantize_mpeg2_intra_c(MpegEncContext *s, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void dct_unquantize_mpeg2_intra_bitexact(MpegEncContext *s, |
|
|
|
|
|
|
|
DCTELEM *block, int n, int qscale) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int i, level, nCoeffs; |
|
|
|
|
|
|
|
const uint16_t *quant_matrix; |
|
|
|
|
|
|
|
int sum=-1; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(s->alternate_scan) nCoeffs= 63; |
|
|
|
|
|
|
|
else nCoeffs= s->block_last_index[n]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (n < 4) |
|
|
|
|
|
|
|
block[0] = block[0] * s->y_dc_scale; |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
block[0] = block[0] * s->c_dc_scale; |
|
|
|
|
|
|
|
quant_matrix = s->intra_matrix; |
|
|
|
|
|
|
|
for(i=1;i<=nCoeffs;i++) { |
|
|
|
|
|
|
|
int j= s->intra_scantable.permutated[i]; |
|
|
|
|
|
|
|
level = block[j]; |
|
|
|
|
|
|
|
if (level) { |
|
|
|
|
|
|
|
if (level < 0) { |
|
|
|
|
|
|
|
level = -level; |
|
|
|
|
|
|
|
level = (int)(level * qscale * quant_matrix[j]) >> 3; |
|
|
|
|
|
|
|
level = -level; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
level = (int)(level * qscale * quant_matrix[j]) >> 3; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
block[j] = level; |
|
|
|
|
|
|
|
sum+=level; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
block[63]^=sum&1; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, |
|
|
|
static void dct_unquantize_mpeg2_inter_c(MpegEncContext *s, |
|
|
|
DCTELEM *block, int n, int qscale) |
|
|
|
DCTELEM *block, int n, int qscale) |
|
|
|
{ |
|
|
|
{ |
|
|
|