Merge commit '9953ff3cd8
'
* commit '9953ff3cd8
':
mpegvideo: fix indentation
sws: do not use av_pix_fmt_descriptors directly.
Conflicts:
libavcodec/mpegvideo.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
a9bd51b1e6
6 changed files with 131 additions and 65 deletions
|
@ -197,7 +197,11 @@ extern const int32_t ff_yuv2rgb_coeffs[8][4];
|
|||
#if FF_API_SWS_FORMAT_NAME
|
||||
const char *sws_format_name(enum AVPixelFormat format)
|
||||
{
|
||||
return av_get_pix_fmt_name(format);
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
|
||||
if (desc)
|
||||
return desc->name;
|
||||
else
|
||||
return "Unknown format";
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -767,14 +771,17 @@ static int initMMX2HScaler(int dstW, int xInc, uint8_t *filterCode,
|
|||
|
||||
static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
|
||||
{
|
||||
*h = av_pix_fmt_descriptors[format].log2_chroma_w;
|
||||
*v = av_pix_fmt_descriptors[format].log2_chroma_h;
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
|
||||
*h = desc->log2_chroma_w;
|
||||
*v = desc->log2_chroma_h;
|
||||
}
|
||||
|
||||
int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
|
||||
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);
|
||||
memcpy(c->srcColorspaceTable, inv_table, sizeof(int) * 4);
|
||||
memcpy(c->dstColorspaceTable, table, sizeof(int) * 4);
|
||||
|
||||
|
@ -786,8 +793,8 @@ int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4],
|
|||
if (isYUV(c->dstFormat) || isGray(c->dstFormat))
|
||||
return -1;
|
||||
|
||||
c->dstFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[c->dstFormat]);
|
||||
c->srcFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[c->srcFormat]);
|
||||
c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
|
||||
c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
|
||||
|
||||
ff_yuv2rgb_c_init_tables(c, inv_table, srcRange, brightness,
|
||||
contrast, saturation);
|
||||
|
@ -873,6 +880,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
|
|||
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);
|
||||
|
||||
cpu_flags = av_get_cpu_flags();
|
||||
flags = c->flags;
|
||||
|
@ -935,8 +944,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
|
|||
|
||||
c->lumXInc = (((int64_t)srcW << 16) + (dstW >> 1)) / dstW;
|
||||
c->lumYInc = (((int64_t)srcH << 16) + (dstH >> 1)) / dstH;
|
||||
c->dstFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[dstFormat]);
|
||||
c->srcFormatBpp = av_get_bits_per_pixel(&av_pix_fmt_descriptors[srcFormat]);
|
||||
c->dstFormatBpp = av_get_bits_per_pixel(desc_dst);
|
||||
c->srcFormatBpp = av_get_bits_per_pixel(desc_src);
|
||||
c->vRounder = 4 * 0x0001000100010001ULL;
|
||||
|
||||
usesVFilter = (srcFilter->lumV && srcFilter->lumV->length > 1) ||
|
||||
|
@ -1015,10 +1024,10 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
|
|||
}
|
||||
}
|
||||
|
||||
c->srcBpc = 1 + av_pix_fmt_descriptors[srcFormat].comp[0].depth_minus1;
|
||||
c->srcBpc = 1 + desc_src->comp[0].depth_minus1;
|
||||
if (c->srcBpc < 8)
|
||||
c->srcBpc = 8;
|
||||
c->dstBpc = 1 + av_pix_fmt_descriptors[dstFormat].comp[0].depth_minus1;
|
||||
c->dstBpc = 1 + desc_dst->comp[0].depth_minus1;
|
||||
if (c->dstBpc < 8)
|
||||
c->dstBpc = 8;
|
||||
if (isAnyRGB(srcFormat) || srcFormat == AV_PIX_FMT_PAL8)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue