aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2013-10-21 15:57:07 +0200
committerStefano Sabatini <stefasab@gmail.com>2013-10-24 08:12:38 +0200
commitff9d11f95debed37457f0dc94a0c599a4801b0f1 (patch)
tree7f97f34b047a54c580bb23ae0df02c8ec309c148 /libswscale
parent2f31b73a11d676e3f7f66139ff5c745317e8f1a3 (diff)
downloadffmpeg-ff9d11f95debed37457f0dc94a0c599a4801b0f1.tar.gz
lsws: use av_pix_fmt_get_chroma_sub_sample()
Remove duplicated getSubSampleFactors() function. Simplify.
Diffstat (limited to 'libswscale')
-rw-r--r--libswscale/utils.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 0743ee3531..69087dc3fa 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -821,13 +821,6 @@ static av_cold int init_hscaler_mmxext(int dstW, int xInc, uint8_t *filterCode,
}
#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)
{
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->chrH && dstFilter->chrH->length > 1);
- getSubSampleFactors(&c->chrSrcHSubSample, &c->chrSrcVSubSample, srcFormat);
- getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
+ av_pix_fmt_get_chroma_sub_sample(srcFormat, &c->chrSrcHSubSample, &c->chrSrcVSubSample);
+ av_pix_fmt_get_chroma_sub_sample(dstFormat, &c->chrDstHSubSample, &c->chrDstVSubSample);
if (isAnyRGB(dstFormat) && !(flags&SWS_FULL_CHR_H_INT)) {
if (dstW&1) {