comparison libmpeg2/libmpeg2_changes.diff @ 31329:60709ef498be

Reinstate libmpeg2 hook to export quantization The quant value is used by the postproc filters to fine tune their application
author lu_zero
date Mon, 14 Jun 2010 08:55:32 +0000
parents a51baa308479
children 32a214ee10e5
comparison
equal deleted inserted replaced
31328:599bf04eceeb 31329:60709ef498be
124 -#ifdef ARCH_PPC 124 -#ifdef ARCH_PPC
125 +#if ARCH_PPC 125 +#if ARCH_PPC
126 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) { 126 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
127 mpeg2_cpu_state_save = state_save_altivec; 127 mpeg2_cpu_state_save = state_save_altivec;
128 mpeg2_cpu_state_restore = state_restore_altivec; 128 mpeg2_cpu_state_restore = state_restore_altivec;
129 --- libmpeg2/header.c 2006-06-16 20:12:26.000000000 +0200
130 +++ libmpeg2/header.c 2006-06-16 20:12:50.000000000 +0200
131 @@ -872,6 +879,7 @@
132 mpeg2dec->scaled[idx] = decoder->q_scale_type;
133 for (i = 0; i < 32; i++) {
134 k = decoder->q_scale_type ? non_linear_scale[i] : (i << 1);
135 + decoder->quantizer_scales[i] = k;
136 for (j = 0; j < 64; j++)
137 decoder->quantizer_prescale[idx][i][j] =
138 k * mpeg2dec->quantizer_matrix[idx][j];
129 --- libmpeg2/idct.c (revision 26652) 139 --- libmpeg2/idct.c (revision 26652)
130 +++ libmpeg2/idct.c (working copy) 140 +++ libmpeg2/idct.c (working copy)
131 @@ -235,34 +239,40 @@ 141 @@ -235,34 +239,40 @@
132 142
133 void mpeg2_idct_init (uint32_t accel) 143 void mpeg2_idct_init (uint32_t accel)
331 341
332 #include <inttypes.h> 342 #include <inttypes.h>
333 343
334 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200 344 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200
335 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 345 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200
346 @@ -152,6 +156,11 @@
347
348 /* XXX: stuff due to xine shit */
349 int8_t q_scale_type;
350 +
351 + int quantizer_scales[32];
352 + int quantizer_scale;
353 + char* quant_store;
354 + int quant_stride;
355 };
356
357 typedef struct {
336 @@ -226,7 +238,7 @@ 358 @@ -226,7 +238,7 @@
337 }; 359 };
338 360
339 typedef struct { 361 typedef struct {
340 -#ifdef ARCH_PPC 362 -#ifdef ARCH_PPC
341 +#if ARCH_PPC 363 +#if ARCH_PPC
342 uint8_t regv[12*16]; 364 uint8_t regv[12*16];
343 #endif 365 #endif
344 int dummy; 366 int dummy;
367 --- libmpeg2/slice.c 2006-06-16 20:12:26.000000000 +0200
368 +++ libmpeg2/slice.c 2006-06-16 20:12:50.000000000 +0200
369 @@ -142,6 +146,7 @@
370
371 quantizer_scale_code = UBITS (bit_buf, 5);
372 DUMPBITS (bit_buf, bits, 5);
373 + decoder->quantizer_scale = decoder->quantizer_scales[quantizer_scale_code];
374
375 decoder->quantizer_matrix[0] =
376 decoder->quantizer_prescale[0][quantizer_scale_code];
377 @@ -1564,6 +1569,24 @@
378
379 #define NEXT_MACROBLOCK \
380 do { \
381 + if(decoder->quant_store) { \
382 + if (decoder->picture_structure == TOP_FIELD) \
383 + decoder->quant_store[2 * decoder->quant_stride \
384 + * (decoder->v_offset >> 4) \
385 + + (decoder->offset >> 4)] \
386 + = decoder->quantizer_scale; \
387 + else if (decoder->picture_structure == BOTTOM_FIELD) \
388 + decoder->quant_store[2 * decoder->quant_stride \
389 + * (decoder->v_offset >> 4) \
390 + + decoder->quant_stride \
391 + + (decoder->offset >> 4)] \
392 + = decoder->quantizer_scale; \
393 + else \
394 + decoder->quant_store[decoder->quant_stride \
395 + * (decoder->v_offset >> 4) \
396 + + (decoder->offset >> 4)] \
397 + = decoder->quantizer_scale; \
398 + } \
399 decoder->offset += 16; \
400 if (decoder->offset == decoder->width) { \
401 do { /* just so we can use the break statement */ \