mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-04 06:08:26 +02:00
lsws: use av_pix_fmt_get_chroma_sub_sample()
Remove duplicated getSubSampleFactors() function. Simplify.
This commit is contained in:
parent
2f31b73a11
commit
ff9d11f95d
@ -821,13 +821,6 @@ static av_cold int init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode,
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_MMXEXT_INLINE */
|
#endif /* HAVE_MMXEXT_INLINE */
|
||||||
|
|
||||||
static void getSubSampleFactors(int *h, int *v, enum AVPixelFormat format)
|
|
||||||
{
|
|
||||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(format);
|
|
||||||
*h = desc->log2_chroma_w;
|
|
||||||
*v = desc->log2_chroma_h;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void fill_rgb2yuv_table(SwsContext *c, const int table[4], int dstRange)
|
static void fill_rgb2yuv_table(SwsContext *c, const int table[4], int dstRange)
|
||||||
{
|
{
|
||||||
int64_t W, V, Z, Cy, Cu, Cv;
|
int64_t W, V, Z, Cy, Cu, Cv;
|
||||||
@ -1199,8 +1192,8 @@ av_cold int sws_init_context(SwsContext *c, SwsFilter *srcFilter,
|
|||||||
(dstFilter->lumH && dstFilter->lumH->length > 1) ||
|
(dstFilter->lumH && dstFilter->lumH->length > 1) ||
|
||||||
(dstFilter->chrH && dstFilter->chrH->length > 1);
|
(dstFilter->chrH && dstFilter->chrH->length > 1);
|
||||||
|
|
||||||
getSubSampleFactors(&c->chrSrcHSubSample, &c->chrSrcVSubSample, srcFormat);
|
av_pix_fmt_get_chroma_sub_sample(srcFormat, &c->chrSrcHSubSample, &c->chrSrcVSubSample);
|
||||||
getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
|
av_pix_fmt_get_chroma_sub_sample(dstFormat, &c->chrDstHSubSample, &c->chrDstVSubSample);
|
||||||
|
|
||||||
if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) {
|
if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) {
|
||||||
if (dstW&1) {
|
if (dstW&1) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user