From: Darren S. <li...@yo...> - 2012-02-15 00:56:40
|
# HG changeset patch # User Darren Salt <li...@yo...> # Date 1329267128 0 # Node ID 684a174dd01a7432cd4317d8f9d1066f997f1133 # Branch default # Parent 32d275faee7f09ec8a304c110a2b71413a8d9839 # Parent bfb7fac474adfbbf81ad483890ac2cc771ed3d12 Merge from 1.1. diff --git a/include/xine/xineutils.h b/include/xine/xineutils.h --- a/include/xine/xineutils.h +++ b/include/xine/xineutils.h @@ -254,20 +254,21 @@ unsigned char *v_dst, int v_dst_pitch, int width, int height) XINE_PROTECTED; -/* convert full range rgb to mpeg range yuv */ -#define SCALESHIFT 16 -#define SCALEFACTOR (1<<SCALESHIFT) +#define SCALEFACTOR 65536 #define CENTERSAMPLE 128 +/* These conversions are normalised for the MPEG Y'CbCr colourspace. + * (Yes, we know that we call it YUV elsewhere.) + */ #define COMPUTE_Y(r, g, b) \ (unsigned char) \ - (((y_r_table[r] + y_g_table[g] + y_b_table[b]) >> SCALESHIFT) + 16) + ((y_r_table[r] + y_g_table[g] + y_b_table[b]) / SCALEFACTOR) #define COMPUTE_U(r, g, b) \ (unsigned char) \ - (((u_r_table[r] + u_g_table[g] + u_b_table[b]) >> SCALESHIFT) + CENTERSAMPLE) + ((u_r_table[r] + u_g_table[g] + u_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) #define COMPUTE_V(r, g, b) \ (unsigned char) \ - (((v_r_table[r] + v_g_table[g] + v_b_table[b]) >> SCALESHIFT) + CENTERSAMPLE) + ((v_r_table[r] + v_g_table[g] + v_b_table[b]) / SCALEFACTOR + CENTERSAMPLE) #define UNPACK_BGR15(packed_pixel, r, g, b) \ b = (packed_pixel & 0x7C00) >> 7; \ --git a/src/xine-utils/color.c b/src/xine-utils/color.c --- a/src/xine-utils/color.c +++ b/src/xine-utils/color.c @@ -67,52 +67,46 @@ /* * In search of the perfect colorspace conversion formulae... - * These are the conversion equations that xine currently uses: + * These are the conversion equations that xine currently uses + * (before normalisation): * * Y = 0.29900 * R + 0.58700 * G + 0.11400 * B * U = -0.16874 * R - 0.33126 * G + 0.50000 * B + 128 * V = 0.50000 * R - 0.41869 * G - 0.08131 * B + 128 - * - * Feel free to experiment with different coefficients by altering the - * next 9 defines. */ -/* convert full range rgb to mpeg range yuv */ -#if 0 +/* +#define Y_R (SCALEFACTOR * 0.29900 * 219.0 / 255.0) +#define Y_G (SCALEFACTOR * 0.58700 * 219.0 / 255.0) +#define Y_B (SCALEFACTOR * 0.11400 * 219.0 / 255.0) -#define Y_R (SCALEFACTOR * 0.29900) -#define Y_G (SCALEFACTOR * 0.58700) -#define Y_B (SCALEFACTOR * 0.11400) +#define U_R (SCALEFACTOR * -0.16874 * 224.0 / 255.0) +#define U_G (SCALEFACTOR * -0.33126 * 224.0 / 255.0) +#define U_B (SCALEFACTOR * 0.50000 * 224.0 / 255.0) -#define U_R (SCALEFACTOR * -0.16874) -#define U_G (SCALEFACTOR * -0.33126) -#define U_B (SCALEFACTOR * 0.50000) +#define V_R (SCALEFACTOR * 0.50000 * 224.0 / 255.0) +#define V_G (SCALEFACTOR * -0.41869 * 224.0 / 255.0) +#define V_B (SCALEFACTOR * -0.08131 * 224.0 / 255.0) +*/ -#define V_R (SCALEFACTOR * 0.50000) -#define V_G (SCALEFACTOR * -0.41869) -#define V_B (SCALEFACTOR * -0.08131) +#define Y_R (SCALEFACTOR * 0.299 * 219.0 / 255.0) +#define Y_G (SCALEFACTOR * 0.587 * 219.0 / 255.0) +#define Y_B (SCALEFACTOR * 0.114 * 219.0 / 255.0) -#else +#define U_R (SCALEFACTOR * -0.299 / 1.772 * 224.0 / 255.0) +#define U_G (SCALEFACTOR * -0.587 / 1.772 * 224.0 / 255.0) +#define U_B (SCALEFACTOR * 0.886 / 1.772 * 224.0 / 255.0) + +#define V_R (SCALEFACTOR * 0.701 / 1.402 * 224.0 / 255.0) +#define V_G (SCALEFACTOR * -0.587 / 1.402 * 224.0 / 255.0) +#define V_B (SCALEFACTOR * -0.114 / 1.402 * 224.0 / 255.0) /* - * Here is another promising set of coefficients. If you use these, you - * must also add 16 to the Y calculation in the COMPUTE_Y macro found - * in xineutils.h. + * With the normalisation factors above, Y needs 16 added. + * This is done during setup, not in the macros in xineutils.h, because + * doing it there would be an API change. */ - -#define Y_R (SCALEFACTOR * 0.257) -#define Y_G (SCALEFACTOR * 0.504) -#define Y_B (SCALEFACTOR * 0.098) - -#define U_R (SCALEFACTOR * -0.148) -#define U_G (SCALEFACTOR * -0.291) -#define U_B (SCALEFACTOR * 0.439) - -#define V_R (SCALEFACTOR * 0.439) -#define V_G (SCALEFACTOR * -0.368) -#define V_B (SCALEFACTOR * -0.071) - -#endif +#define Y_MOD (16 * SCALEFACTOR) /* * Precalculate all of the YUV tables since it requires fewer than @@ -1319,7 +1313,7 @@ /* initialize the RGB -> YUV tables */ for (i = 0; i < 256; i++) { - y_r_table[i] = Y_R * i; + y_r_table[i] = Y_R * i + Y_MOD; y_g_table[i] = Y_G * i; y_b_table[i] = Y_B * i; |
From: Darren S. <de...@mo...> - 2012-06-09 21:08:36
|
# HG changeset patch # User Darren Salt <de...@mo...> # Date 1339263059 -3600 # Node ID 066fb48744bb30c4beec6b4c8fc1b3592936033a # Branch default # Parent 409e1b9e704d1ab4023b563811c277274a51802e # Parent 948bb6010a3e36f1f555fd6215e3db638e8c0b30 Merge from 1.1. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -82,18 +82,20 @@ * Report more video output capabilities via (port)->get_capabilities(): colour controls, zooming, colour keying. -xine-lib (1.1.21) ????-??-?? - * mpeg-ts fixes and enhancements +xine-lib (1.1.21) 2012-06-09 + * Fix a potential double-free (goom) when playing AAC files. + * Fix a possible clean-up crash in the goom FFT code. + * Fix matroska header compression. + * MPEG-TS fixes and enhancements * Improved syncing of DVB subtitles * BluRay support (requires libbluray) * Fix full range YUV (with ffmpeg codecs) * Fix multithreading with recent ffmpeg versions * Fix cropping with ffmpeg codecs * Fix OSD when using OpenGL video output - -xine-lib (1.1.20.2) ????-??-?? + * xine-list no longer causes catalog.cache to be written. + * Windows-related (cygwin, mingw) build fixes. * Various bug fixes. - * Fix matroska header compression. xine-lib (1.1.20.1) 2012-01-01 * Various bug fixes. --git a/src/audio_dec/xine_faad_decoder.c b/src/audio_dec/xine_faad_decoder.c --- a/src/audio_dec/xine_faad_decoder.c +++ b/src/audio_dec/xine_faad_decoder.c @@ -250,8 +250,10 @@ lprintf("NeAACDecDecode() returned rate=%"PRId32" channels=%d used=%d\n", this->rate, this->num_channels, used); - this->stream->audio_out->close (this->stream->audio_out, this->stream); - this->output_open = 0; + if (this->output_open) { + this->stream->audio_out->close (this->stream->audio_out, this->stream); + this->output_open = 0; + } faad_open_output( this ); faad_meta_info_set( this ); --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c --- a/src/demuxers/demux_aac.c +++ b/src/demuxers/demux_aac.c @@ -91,7 +91,7 @@ return 0; /* Check for an ADIF header - should be at the start of the file */ - if (_x_is_fourcc(peak, "AIDF")) { + if (_x_is_fourcc(peak, "ADIF")) { lprintf("found ADIF header\n"); return 1; } --git a/src/post/visualizations/fft.c b/src/post/visualizations/fft.c --- a/src/post/visualizations/fft.c +++ b/src/post/visualizations/fft.c @@ -153,10 +153,13 @@ void fft_dispose(fft_t *fft) { - free(fft->SineTable); - free(fft->CosineTable); - free(fft->WinTable); - free(fft); + if (fft) + { + free(fft->SineTable); + free(fft->CosineTable); + free(fft->WinTable); + free(fft); + } } /* |