int srcRange, const int table[4], int dstRange,
int brightness, int contrast, int saturation)
{
- const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(c->dstFormat);
- const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(c->srcFormat);
+ const AVPixFmtDescriptor *desc_dst;
+ const AVPixFmtDescriptor *desc_src;
memcpy(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
memcpy(c->dstColorspaceTable, table, sizeof(int) * 4);
+ handle_formats(c);
+ desc_dst = av_pix_fmt_desc_get(c->dstFormat);
+ desc_src = av_pix_fmt_desc_get(c->srcFormat);
+
if(!isYUV(c->dstFormat) && !isGray(c->dstFormat))
dstRange = 0;
if(!isYUV(c->srcFormat) && !isGray(c->srcFormat))
int flags, cpu_flags;
enum AVPixelFormat srcFormat = c->srcFormat;
enum AVPixelFormat dstFormat = c->dstFormat;
- const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
- const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
+ const AVPixFmtDescriptor *desc_src;
+ const AVPixFmtDescriptor *desc_dst;
cpu_flags = av_get_cpu_flags();
flags = c->flags;
unscaled = (srcW == dstW && srcH == dstH);
- handle_jpeg(&srcFormat);
- handle_jpeg(&dstFormat);
+ handle_jpeg(&c->srcFormat);
+ handle_jpeg(&c->dstFormat);
if(srcFormat!=c->srcFormat || dstFormat!=c->dstFormat)
av_log(c, AV_LOG_WARNING, "deprecated pixel format used, make sure you did set range correctly\n");
- handle_0alpha(&srcFormat);
- handle_0alpha(&dstFormat);
- handle_xyz(&srcFormat);
- handle_xyz(&dstFormat);
-
- if(srcFormat!=c->srcFormat || dstFormat!=c->dstFormat){
- c->srcFormat= srcFormat;
- c->dstFormat= dstFormat;
- }
+ handle_formats(c);
+ srcFormat = c->srcFormat;
+ dstFormat = c->dstFormat;
+ desc_src = av_pix_fmt_desc_get(srcFormat);
+ desc_dst = av_pix_fmt_desc_get(dstFormat);
if (!(unscaled && sws_isSupportedEndiannessConversion(srcFormat) &&
av_pix_fmt_swap_endianness(srcFormat) == dstFormat)) {
c->dstRange = handle_jpeg(&dstFormat);
c->srcFormat = srcFormat;
c->dstFormat = dstFormat;
- handle_formats(c);
if (param) {
c->param[0] = param[0];
context->dstH = dstH;
context->dstRange = handle_jpeg(&dstFormat);
context->dstFormat = dstFormat;
- handle_formats(context);
context->flags = flags;
context->param[0] = param[0];
context->param[1] = param[1];