summaryrefslogtreecommitdiffstats
path: root/libswscale/swscale.c
diff options
context:
space:
mode:
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r--libswscale/swscale.c135
1 files changed, 68 insertions, 67 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index a22bf64b71..88ac39757e 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -46,7 +46,7 @@ tested special converters (most are tested actually, but I did not write it down
YVU9 -> YV12
untested special converters
- YV12/I420 -> BGR15/BGR24/BGR32 (it is the yuv2rgb stuff, so it should be ok)
+ YV12/I420 -> BGR15/BGR24/BGR32 (it is the yuv2rgb stuff, so it should be OK)
YV12/I420 -> YV12/I420
YUY2/BGR15/BGR24/BGR32/RGB24/RGB32 -> same format
BGR24 -> BGR32 & RGB24 -> RGB32
@@ -83,15 +83,15 @@ unsigned swscale_version(void)
#undef PAVGB
//#undef HAVE_MMX2
-//#define HAVE_3DNOW
+//#define HAVE_AMD3DNOW
//#undef HAVE_MMX
//#undef ARCH_X86
//#define WORDS_BIGENDIAN
#define DITHER1XBPP
-#define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
+#define FAST_BGR2YV12 // use 7 bit coefficients instead of 15 bit
-#define RET 0xC3 //near return opcode for X86
+#define RET 0xC3 //near return opcode for x86
#ifdef M_PI
#define PI M_PI
@@ -194,10 +194,10 @@ Special versions: fast Y 1:1 scaling (no interpolation in y direction)
TODO
more intelligent misalignment avoidance for the horizontal scaler
write special vertical cubic upscale version
-Optimize C code (yv12 / minmax)
-add support for packed pixel yuv input & output
+optimize C code (YV12 / minmax)
+add support for packed pixel YUV input & output
add support for Y8 output
-optimize bgr24 & bgr32
+optimize BGR24 & BGR32
add BGR4 output support
write special BGR->BGR scaler
*/
@@ -257,7 +257,7 @@ DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUV[2][4]) = {
DECLARE_ASM_CONST(8, uint64_t, ff_bgr24toUVOffset)= 0x0040400000404000ULL;
-#endif /* ARCH_X86 */
+#endif /* ARCH_X86 && CONFIG_GPL */
// clipping helper table for C implementations:
static unsigned char clip_table[768];
@@ -471,7 +471,7 @@ static inline void yuv2yuvXinC(int16_t *lumFilter, int16_t **lumSrc, int lumFilt
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, uint8_t *vDest, int dstW, int chrDstW)
{
- //FIXME Optimize (just quickly writen not opti..)
+ //FIXME Optimize (just quickly written not optimized..)
int i;
for (i=0; i<dstW; i++)
{
@@ -504,7 +504,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
int16_t *chrFilter, int16_t **chrSrc, int chrFilterSize,
uint8_t *dest, uint8_t *uDest, int dstW, int chrDstW, int dstFormat)
{
- //FIXME Optimize (just quickly writen not opti..)
+ //FIXME Optimize (just quickly written not optimized..)
int i;
for (i=0; i<dstW; i++)
{
@@ -653,7 +653,7 @@ static inline void yuv2nv12XinC(int16_t *lumFilter, int16_t **lumSrc, int lumFil
}
#define YSCALE_YUV_2_RGBX_C(type) \
- YSCALE_YUV_2_PACKEDX_C(type) /* FIXME fix tables so that cliping is not needed and then use _NOCLIP*/\
+ YSCALE_YUV_2_PACKEDX_C(type) /* FIXME fix tables so that clipping is not needed and then use _NOCLIP*/\
r = (type *)c->table_rV[V]; \
g = (type *)(c->table_gU[U] + c->table_gV[V]); \
b = (type *)c->table_bU[U]; \
@@ -953,7 +953,7 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
}
}
-//Note: we have C, X86, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
+//Note: we have C, X86, MMX, MMX2, 3DNOW versions, there is no 3DNOW+MMX2 one
//Plain C versions
#if !HAVE_MMX || defined (RUNTIME_CPUDETECT) || !CONFIG_GPL
#define COMPILE_C
@@ -961,13 +961,14 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
#if ARCH_PPC
#if (HAVE_ALTIVEC || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
+#undef COMPILE_C
#define COMPILE_ALTIVEC
-#endif //HAVE_ALTIVEC
+#endif
#endif //ARCH_PPC
#if ARCH_X86
-#if ((HAVE_MMX && !HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
+#if ((HAVE_MMX && !HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
#define COMPILE_MMX
#endif
@@ -975,18 +976,18 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
#define COMPILE_MMX2
#endif
-#if ((HAVE_3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
+#if ((HAVE_AMD3DNOW && !HAVE_MMX2) || defined (RUNTIME_CPUDETECT)) && CONFIG_GPL
#define COMPILE_3DNOW
#endif
-#endif //ARCH_X86 || ARCH_X86_64
+#endif //ARCH_X86
#undef HAVE_MMX
#undef HAVE_MMX2
-#undef HAVE_3DNOW
+#undef HAVE_AMD3DNOW
#undef HAVE_ALTIVEC
#define HAVE_MMX 0
#define HAVE_MMX2 0
-#define HAVE_3DNOW 0
+#define HAVE_AMD3DNOW 0
#define HAVE_ALTIVEC 0
#ifdef COMPILE_C
@@ -1004,12 +1005,12 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
#if ARCH_X86
-//X86 versions
+//x86 versions
/*
#undef RENAME
#undef HAVE_MMX
#undef HAVE_MMX2
-#undef HAVE_3DNOW
+#undef HAVE_AMD3DNOW
#define ARCH_X86
#define RENAME(a) a ## _X86
#include "swscale_template.c"
@@ -1019,10 +1020,10 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
#undef RENAME
#undef HAVE_MMX
#undef HAVE_MMX2
-#undef HAVE_3DNOW
+#undef HAVE_AMD3DNOW
#define HAVE_MMX 1
#define HAVE_MMX2 0
-#define HAVE_3DNOW 0
+#define HAVE_AMD3DNOW 0
#define RENAME(a) a ## _MMX
#include "swscale_template.c"
#endif
@@ -1032,10 +1033,10 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
#undef RENAME
#undef HAVE_MMX
#undef HAVE_MMX2
-#undef HAVE_3DNOW
+#undef HAVE_AMD3DNOW
#define HAVE_MMX 1
#define HAVE_MMX2 1
-#define HAVE_3DNOW 0
+#define HAVE_AMD3DNOW 0
#define RENAME(a) a ## _MMX2
#include "swscale_template.c"
#endif
@@ -1045,17 +1046,17 @@ static inline void yuv2rgbXinC_full(SwsContext *c, int16_t *lumFilter, int16_t *
#undef RENAME
#undef HAVE_MMX
#undef HAVE_MMX2
-#undef HAVE_3DNOW
+#undef HAVE_AMD3DNOW
#define HAVE_MMX 1
#define HAVE_MMX2 0
-#define HAVE_3DNOW 1
+#define HAVE_AMD3DNOW 1
#define RENAME(a) a ## _3DNow
#include "swscale_template.c"
#endif
-#endif //ARCH_X86 || ARCH_X86_64
+#endif //ARCH_X86
-// minor note: the HAVE_xyz is messed up after that line so don't use it
+// minor note: the HAVE_xyz are messed up after this line so don't use them
static double getSplineCoeff(double a, double b, double c, double d, double dist)
{
@@ -1085,7 +1086,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
__asm__ volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
#endif
- // Note the +1 is for the MMXscaler which reads over the end
+ // NOTE: the +1 is for the MMX scaler which reads over the end
*filterPos = av_malloc((dstW+1)*sizeof(int16_t));
if (FFABS(xInc - 0x10000) <10) // unscaled
@@ -1134,7 +1135,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
int j;
(*filterPos)[i]= xx;
- //Bilinear upscale / linear interpolate / Area averaging
+ //bilinear upscale / linear interpolate / area averaging
for (j=0; j<filterSize; j++)
{
int64_t coeff= fone - FFABS((xx<<16) - xDstInSrc)*(fone>>16);
@@ -1315,7 +1316,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
/* preserve monotonicity because the core can't handle the filter otherwise */
if (i<dstW-1 && (*filterPos)[i] >= (*filterPos)[i+1]) break;
- // Move filter coeffs left
+ // move filter coefficients left
for (k=1; k<filter2Size; k++)
filter2[i*filter2Size + k - 1]= filter2[i*filter2Size + k];
filter2[i*filter2Size + k - 1]= 0;
@@ -1341,10 +1342,10 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
if (minFilterSize < 5)
filterAlign = 4;
- // we really don't want to waste our time
- // doing useless computation, so fall-back on
- // the scalar C code for very small filter.
- // vectorizing is worth it only if you have
+ // We really don't want to waste our time
+ // doing useless computation, so fall back on
+ // the scalar C code for very small filters.
+ // Vectorizing is worth it only if you have a
// decent-sized vector.
if (minFilterSize < 3)
filterAlign = 1;
@@ -1381,7 +1382,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
}
- //FIXME try to align filterpos if possible
+ //FIXME try to align filterPos if possible
//fix borders
for (i=0; i<dstW; i++)
@@ -1389,7 +1390,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
int j;
if ((*filterPos)[i] < 0)
{
- // Move filter coeffs left to compensate for filterPos
+ // move filter coefficients left to compensate for filterPos
for (j=1; j<filterSize; j++)
{
int left= FFMAX(j + (*filterPos)[i], 0);
@@ -1402,7 +1403,7 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
if ((*filterPos)[i] + filterSize > srcW)
{
int shift= (*filterPos)[i] + filterSize - srcW;
- // Move filter coeffs right to compensate for filterPos
+ // move filter coefficients right to compensate for filterPos
for (j=filterSize-2; j>=0; j--)
{
int right= FFMIN(j + shift, filterSize-1);
@@ -1413,11 +1414,11 @@ static inline int initFilter(int16_t **outFilter, int16_t **filterPos, int *outF
}
}
- // Note the +1 is for the MMXscaler which reads over the end
+ // Note the +1 is for the MMX scaler which reads over the end
/* align at 16 for AltiVec (needed by hScale_altivec_real) */
*outFilter= av_mallocz(*outFilterSize*(dstW+1)*sizeof(int16_t));
- /* Normalize & Store in outFilter */
+ /* normalize & store in outFilter */
for (i=0; i<dstW; i++)
{
int j;
@@ -1660,7 +1661,7 @@ static SwsFunc getSwsFunc(int flags){
#else //RUNTIME_CPUDETECT
#if HAVE_MMX2
return swScale_MMX2;
-#elif HAVE_3DNOW
+#elif HAVE_AMD3DNOW
return swScale_3DNow;
#elif HAVE_MMX
return swScale_MMX;
@@ -2075,7 +2076,7 @@ static uint16_t roundToInt16(int64_t f){
}
/**
- * @param inv_table the yuv2rgb coeffs, normally Inverse_Table_6_9[x]
+ * @param inv_table the yuv2rgb coefficients, normally Inverse_Table_6_9[x]
* @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235
* @return -1 if not supported
*/
@@ -2197,7 +2198,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
flags &= ~(SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2|SWS_CPU_CAPS_3DNOW|SWS_CPU_CAPS_ALTIVEC|SWS_CPU_CAPS_BFIN);
#if HAVE_MMX2
flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_MMX2;
-#elif HAVE_3DNOW
+#elif HAVE_AMD3DNOW
flags |= SWS_CPU_CAPS_MMX|SWS_CPU_CAPS_3DNOW;
#elif HAVE_MMX
flags |= SWS_CPU_CAPS_MMX;
@@ -2242,7 +2243,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
|SWS_BICUBLIN);
if(!i || (i & (i-1)))
{
- av_log(NULL, AV_LOG_ERROR, "swScaler: Exactly one scaler algorithm must be choosen\n");
+ av_log(NULL, AV_LOG_ERROR, "swScaler: Exactly one scaler algorithm must be chosen\n");
return NULL;
}
@@ -2254,7 +2255,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
return NULL;
}
if(srcW > VOFW || dstW > VOFW){
- av_log(NULL, AV_LOG_ERROR, "swScaler: Compile time max width is "AV_STRINGIFY(VOFW)" change VOF/VOFW and recompile\n");
+ av_log(NULL, AV_LOG_ERROR, "swScaler: Compile-time maximum width is "AV_STRINGIFY(VOFW)" change VOF/VOFW and recompile\n");
return NULL;
}
@@ -2288,14 +2289,14 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
getSubSampleFactors(&c->chrSrcHSubSample, &c->chrSrcVSubSample, srcFormat);
getSubSampleFactors(&c->chrDstHSubSample, &c->chrDstVSubSample, dstFormat);
- // reuse chroma for 2 pixles rgb/bgr unless user wants full chroma interpolation
+ // reuse chroma for 2 pixels RGB/BGR unless user wants full chroma interpolation
if ((isBGR(dstFormat) || isRGB(dstFormat)) && !(flags&SWS_FULL_CHR_H_INT)) c->chrDstHSubSample=1;
// drop some chroma lines if the user wants it
c->vChrDrop= (flags&SWS_SRC_V_CHR_DROP_MASK)>>SWS_SRC_V_CHR_DROP_SHIFT;
c->chrSrcVSubSample+= c->vChrDrop;
- // drop every 2. pixel for chroma calculation unless user wants full chroma
+ // drop every other pixel for chroma calculation unless user wants full chroma
if ((isBGR(srcFormat) || isRGB(srcFormat)) && !(flags&SWS_FULL_CHR_H_INP)
&& srcFormat!=PIX_FMT_RGB8 && srcFormat!=PIX_FMT_BGR8
&& srcFormat!=PIX_FMT_RGB4 && srcFormat!=PIX_FMT_BGR4
@@ -2322,7 +2323,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
sws_setColorspaceDetails(c, Inverse_Table_6_9[SWS_CS_DEFAULT], srcRange, Inverse_Table_6_9[SWS_CS_DEFAULT] /* FIXME*/, dstRange, 0, 1<<16, 1<<16);
- /* unscaled special Cases */
+ /* unscaled special cases */
if (unscaled && !usesHFilter && !usesVFilter && (srcRange == dstRange || isBGR(dstFormat) || isRGB(dstFormat)))
{
/* yv12_to_nv12 */
@@ -2348,7 +2349,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
if (srcFormat==PIX_FMT_BGR24 && dstFormat==PIX_FMT_YUV420P && !(flags & SWS_ACCURATE_RND))
c->swScale= bgr24toyv12Wrapper;
- /* rgb/bgr -> rgb/bgr (no dither needed forms) */
+ /* RGB/BGR -> RGB/BGR (no dither needed forms) */
if ( (isBGR(srcFormat) || isRGB(srcFormat))
&& (isBGR(dstFormat) || isRGB(dstFormat))
&& srcFormat != PIX_FMT_BGR8 && dstFormat != PIX_FMT_BGR8
@@ -2448,7 +2449,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
if (!c->canMMX2BeUsed && dstW >=srcW && (srcW&15)==0 && (flags&SWS_FAST_BILINEAR))
{
if (flags&SWS_PRINT_INFO)
- av_log(c, AV_LOG_INFO, "output Width is not a multiple of 32 -> no MMX2 scaler\n");
+ av_log(c, AV_LOG_INFO, "output width is not a multiple of 32 -> no MMX2 scaler\n");
}
if (usesHFilter) c->canMMX2BeUsed=0;
}
@@ -2471,7 +2472,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
c->lumXInc+= 20;
c->chrXInc+= 20;
}
- //we don't use the x86asm scaler if mmx is available
+ //we don't use the x86 asm scaler if MMX is available
else if (flags & SWS_CPU_CAPS_MMX)
{
c->lumXInc = ((srcW-2)<<16)/(dstW-2) - 20;
@@ -2517,7 +2518,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
initMMX2HScaler(c->chrDstW, c->chrXInc, c->funnyUVCode, c->chrMmx2Filter, c->chrMmx2FilterPos, 4);
}
#endif /* defined(COMPILE_MMX2) */
- } // Init Horizontal stuff
+ } // initialize horizontal stuff
@@ -2557,7 +2558,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
#endif
}
- // Calculate Buffer Sizes so that they won't run out while handling these damn slices
+ // calculate buffer sizes so that they won't run out while handling these damn slices
c->vLumBufSize= c->vLumFilterSize;
c->vChrBufSize= c->vChrFilterSize;
for (i=0; i<dstH; i++)
@@ -2577,7 +2578,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
// allocate pixbufs (we use dynamic allocation because otherwise we would need to
c->lumPixBuf= av_malloc(c->vLumBufSize*2*sizeof(int16_t*));
c->chrPixBuf= av_malloc(c->vChrBufSize*2*sizeof(int16_t*));
- //Note we need at least one pixel more at the end because of the mmx code (just in case someone wanna replace the 4000/8000)
+ //Note we need at least one pixel more at the end because of the MMX code (just in case someone wanna replace the 4000/8000)
/* align at 16 bytes for AltiVec */
for (i=0; i<c->vLumBufSize; i++)
c->lumPixBuf[i]= c->lumPixBuf[i+c->vLumBufSize]= av_mallocz(VOF+1);
@@ -2668,7 +2669,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
else
{
#if ARCH_X86
- av_log(c, AV_LOG_VERBOSE, "using X86-Asm scaler for horizontal scaling\n");
+ av_log(c, AV_LOG_VERBOSE, "using x86 asm scaler for horizontal scaling\n");
#else
if (flags & SWS_FAST_BILINEAR)
av_log(c, AV_LOG_VERBOSE, "using FAST_BILINEAR C scaler for horizontal scaling\n");
@@ -2695,22 +2696,22 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
}
if (dstFormat==PIX_FMT_BGR24)
- av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR24 Converter\n",
+ av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR24 converter\n",
(flags & SWS_CPU_CAPS_MMX2) ? "MMX2" : ((flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C"));
else if (dstFormat==PIX_FMT_RGB32)
- av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR32 Converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
+ av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR32 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
else if (dstFormat==PIX_FMT_BGR565)
- av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR16 Converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
+ av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR16 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
else if (dstFormat==PIX_FMT_BGR555)
- av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR15 Converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
+ av_log(c, AV_LOG_VERBOSE, "using %s YV12->BGR15 converter\n", (flags & SWS_CPU_CAPS_MMX) ? "MMX" : "C");
av_log(c, AV_LOG_VERBOSE, "%dx%d -> %dx%d\n", srcW, srcH, dstW, dstH);
}
if (flags & SWS_PRINT_INFO)
{
- av_log(c, AV_LOG_DEBUG, "Lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
+ av_log(c, AV_LOG_DEBUG, "lum srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
c->srcW, c->srcH, c->dstW, c->dstH, c->lumXInc, c->lumYInc);
- av_log(c, AV_LOG_DEBUG, "Chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
+ av_log(c, AV_LOG_DEBUG, "chr srcW=%d srcH=%d dstW=%d dstH=%d xInc=%d yInc=%d\n",
c->chrSrcW, c->chrSrcH, c->chrDstW, c->chrDstH, c->chrXInc, c->chrYInc);
}
@@ -2720,7 +2721,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
/**
* swscale wrapper, so we don't need to export the SwsContext.
- * assumes planar YUV to be in YUV order instead of YVU
+ * Assumes planar YUV to be in YUV order instead of YVU.
*/
int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
@@ -2820,7 +2821,7 @@ int sws_scale(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
}
/**
- * swscale wrapper, so we don't need to export the SwsContext
+ * swscale wrapper, so we don't need to export the SwsContext.
*/
int sws_scale_ordered(SwsContext *c, uint8_t* src[], int srcStride[], int srcSliceY,
int srcSliceH, uint8_t* dst[], int dstStride[]){
@@ -2886,8 +2887,8 @@ SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
}
/**
- * returns a normalized gaussian curve used to filter stuff
- * quality=3 is high quality, lowwer is lowwer quality
+ * Returns a normalized Gaussian curve used to filter stuff
+ * quality=3 is high quality, lower is lower quality.
*/
SwsVector *sws_getGaussianVec(double variance, double quality){
const int length= (int)(variance*quality + 0.5) | 1;
@@ -3154,7 +3155,7 @@ void sws_freeContext(SwsContext *c){
#endif
c->funnyYCode=NULL;
c->funnyUVCode=NULL;
-#endif /* ARCH_X86 */
+#endif /* ARCH_X86 && CONFIG_GPL */
av_freep(&c->lumMmx2Filter);
av_freep(&c->chrMmx2Filter);
@@ -3168,7 +3169,7 @@ void sws_freeContext(SwsContext *c){
/**
* Checks if context is valid or reallocs a new one instead.
* If context is NULL, just calls sws_getContext() to get a new one.
- * Otherwise, checks if the parameters are the same already saved in context.
+ * Otherwise, checks if the parameters are the ones already saved in context.
* If that is the case, returns the current context.
* Otherwise, frees context and gets a new one.
*