1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

swscale/utils: If cascaded contexts are used forward sws_setColorspaceDetails() to the first context

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-08-31 00:34:55 +02:00
parent 8e05f9217a
commit 1acd6311a1

View File

@ -855,6 +855,12 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
if (need_reinit && (c->srcBpc == 8 || !isYUV(c->srcFormat))) if (need_reinit && (c->srcBpc == 8 || !isYUV(c->srcFormat)))
ff_sws_init_range_convert(c); ff_sws_init_range_convert(c);
c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
if (c->cascaded_context[0])
return sws_setColorspaceDetails(c->cascaded_context[0],inv_table, srcRange,table, dstRange, brightness, contrast, saturation);
if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat))) { if ((isYUV(c->dstFormat) || isGray(c->dstFormat)) && (isYUV(c->srcFormat) || isGray(c->srcFormat))) {
if (!c->cascaded_context[0] && if (!c->cascaded_context[0] &&
memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4) && memcmp(c->dstColorspaceTable, c->srcColorspaceTable, sizeof(int) * 4) &&
@ -923,9 +929,6 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
return -1; return -1;
} }
c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) { if (!isYUV(c->dstFormat) && !isGray(c->dstFormat)) {
ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness, ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,
contrast, saturation); contrast, saturation);