Commit d28bfc9d authored by Michel Lespinasse's avatar Michel Lespinasse

Also pass q_scale_type thru the generic coding_t structure - we do not

want header.c to manipulate the decoder structures directly.
parent 92e5876e
......@@ -525,7 +525,6 @@ int mpeg2_header_picture (mpeg2dec_t * mpeg2dec)
{
uint8_t * buffer = mpeg2dec->chunk_start;
mpeg2_picture_t * picture = &(mpeg2dec->new_picture);
mpeg2_decoder_t * decoder = &(mpeg2dec->decoder);
coding_t * coding = &(mpeg2dec->coding);
int type;
......@@ -567,7 +566,7 @@ int mpeg2_header_picture (mpeg2dec_t * mpeg2dec)
/* XXXXXX decode extra_information_picture as well */
decoder->q_scale_type = 0;
coding->q_scale_type = 0;
coding->intra_dc_precision = 8;
coding->frame_pred_frame_dct = 1;
coding->concealment_motion_vectors = 0;
......@@ -581,7 +580,6 @@ static int picture_coding_ext (mpeg2dec_t * mpeg2dec)
{
uint8_t * buffer = mpeg2dec->chunk_start;
mpeg2_picture_t * picture = &(mpeg2dec->new_picture);
mpeg2_decoder_t * decoder = &(mpeg2dec->decoder);
coding_t * coding = &(mpeg2dec->coding);
uint32_t flags;
......@@ -611,7 +609,7 @@ static int picture_coding_ext (mpeg2dec_t * mpeg2dec)
}
coding->frame_pred_frame_dct = (buffer[3] >> 6) & 1;
coding->concealment_motion_vectors = (buffer[3] >> 5) & 1;
decoder->q_scale_type = buffer[3] & 16;
coding->q_scale_type = (buffer[3] >> 4) & 1;
coding->intra_vlc_format = (buffer[3] >> 3) & 1;
coding->alternate_scan = (buffer[3] >> 2) & 1;
if (!(buffer[4] & 0x80))
......
......@@ -151,9 +151,6 @@ struct mpeg2_decoder_s {
int mpeg1;
/* XXX: stuff due to xine shit */
int8_t q_scale_type;
int8_t scaled[4];
};
......@@ -163,6 +160,7 @@ typedef struct {
typedef struct {
int f_code[2][2];
int q_scale_type;
int intra_dc_precision;
int frame_pred_frame_dct;
int concealment_motion_vectors;
......
......@@ -1608,11 +1608,11 @@ static void prescale (mpeg2_decoder_t * decoder, coding_t * coding, int idx)
int i, j, k;
if ((coding->matrix_updates & (1 << idx)) != 0 ||
decoder->scaled[idx] != decoder->q_scale_type) {
decoder->scaled[idx] != coding->q_scale_type) {
coding->matrix_updates &= ~(1 << idx);
decoder->scaled[idx] = decoder->q_scale_type;
decoder->scaled[idx] = coding->q_scale_type;
for (i = 0; i < 32; i++) {
k = decoder->q_scale_type ? non_linear_scale[i] : (i << 1);
k = coding->q_scale_type ? non_linear_scale[i] : (i << 1);
for (j = 0; j < 64; j++)
decoder->quantizer_prescale[idx][i][mpeg2_scan_norm[j]] =
k * coding->quantizer_matrix[idx][j];
......
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