Mercurial > mplayer.hg
comparison libmpeg2/libmpeg2_changes.diff @ 31293:a51baa308479
libmpeg2: Remove local quantizer scale changes related to postprocessing.
Local changes to our locally forked library copy were incompatible with the
upstream version and prevented (easily) using the upstream version instead
of the forked copy. The md5sums of the decoded frames do not change for one
tested sample, so apparently the code is ineffectual and thus, after some
discussion with Luca, I decided that the changes are not worth keeping.
| author | diego |
|---|---|
| date | Thu, 10 Jun 2010 09:52:30 +0000 |
| parents | f60cd3b9d453 |
| children | 60709ef498be |
comparison
equal
deleted
inserted
replaced
| 31292:92f7d389db9f | 31293:a51baa308479 |
|---|---|
| 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]; | |
| 139 --- libmpeg2/idct.c (revision 26652) | 129 --- libmpeg2/idct.c (revision 26652) |
| 140 +++ libmpeg2/idct.c (working copy) | 130 +++ libmpeg2/idct.c (working copy) |
| 141 @@ -235,34 +239,40 @@ | 131 @@ -235,34 +239,40 @@ |
| 142 | 132 |
| 143 void mpeg2_idct_init (uint32_t accel) | 133 void mpeg2_idct_init (uint32_t accel) |
| 341 | 331 |
| 342 #include <inttypes.h> | 332 #include <inttypes.h> |
| 343 | 333 |
| 344 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200 | 334 --- libmpeg2/mpeg2_internal.h 2006-06-16 20:12:26.000000000 +0200 |
| 345 +++ libmpeg2/mpeg2_internal.h 2006-06-16 20:12:50.000000000 +0200 | 335 +++ 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 { | |
| 358 @@ -226,7 +238,7 @@ | 336 @@ -226,7 +238,7 @@ |
| 359 }; | 337 }; |
| 360 | 338 |
| 361 typedef struct { | 339 typedef struct { |
| 362 -#ifdef ARCH_PPC | 340 -#ifdef ARCH_PPC |
| 363 +#if ARCH_PPC | 341 +#if ARCH_PPC |
| 364 uint8_t regv[12*16]; | 342 uint8_t regv[12*16]; |
| 365 #endif | 343 #endif |
| 366 int dummy; | 344 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 */ \ |
