On 18/12/11 05:23, Ronald S. Bultje wrote:
Hi,

On Sat, Dec 17, 2011 at 7:05 PM, Luca Barbato<[email protected]>  wrote:

On 18/12/11 02:57, Ronald S. Bultje wrote:

+            if (firstLumSrcY<   0 || firstLumSrcY + vLumFilterSize>
  c->srcH) {
+                const int16_t **tmpY = (const int16_t **) lumPixBuf + 2
* vLumBufSize;
+                int neg = -firstLumSrcY, i, end = FFMIN(c->srcH -
firstLumSrcY, vLumFilterSize);
+                for (i = 0; i<   neg;            i++)
+                    tmpY[i] = lumSrcPtr[neg];
+                for (     ; i<   end;            i++)
+                    tmpY[i] = lumSrcPtr[i];
+                for (     ; i<   vLumFilterSize; i++)
+                    tmpY[i] = tmpY[i-1];
+                lumSrcPtr = tmpY;
+
+                if (alpSrcPtr) {
+                    const int16_t **tmpA = (const int16_t **) alpPixBuf
+ 2 * vLumBufSize;
+                    for (i = 0; i<   neg;            i++)
+                        tmpA[i] = alpSrcPtr[neg];
+                    for (     ; i<   end;            i++)
+                        tmpA[i] = alpSrcPtr[i];
+                    for (     ; i<   vLumFilterSize; i++)
+                        tmpA[i] = tmpA[i - 1];
+                    alpSrcPtr = tmpA;
+                }


Since that function is already long, what about having those block as
inline functions? That would make it a little more easy to understand.


See attached. I'm not a big fan of it since this code executes per-row and
the generalization means combining U/V is lost.

If there is an advantage just make a bigger function for the two cases =\


--

Luca Barbato
Gentoo/linux
http://dev.gentoo.org/~lu_zero

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to