]> git.sesse.net Git - ffmpeg/blobdiff - libswscale/swscale.c
lavu/frame: put frame QP elements under a new version guard
[ffmpeg] / libswscale / swscale.c
index 4008210abc51d5aef3175ba8aa95605f48febcc7..e9e4f622f518f83563b1793ea2de7af5deed50c9 100644 (file)
@@ -379,7 +379,7 @@ static int swscale(SwsContext *c, const uint8_t *src[],
     int chrBufIndex  = c->chrBufIndex;
     int lastInLumBuf = c->lastInLumBuf;
     int lastInChrBuf = c->lastInChrBuf;
-//    int perform_gamma = c->is_internal_gamma;
+    int perform_gamma = c->is_internal_gamma;
 
 #ifdef NEW_FILTER
     int lumStart = 0;
@@ -392,9 +392,10 @@ static int swscale(SwsContext *c, const uint8_t *src[],
     SwsSlice *hout_slice = &c->slice[c->numSlice-2];
     SwsSlice *vout_slice = &c->slice[c->numSlice-1];
     SwsFilterDescriptor *desc = c->desc;
-#endif
+
     int hasLumHoles = 1;
     int hasChrHoles = 1;
+#endif
 
 #ifndef NEW_FILTER
     if (!usePal(c->srcFormat)) {
@@ -612,8 +613,8 @@ static int swscale(SwsContext *c, const uint8_t *src[],
             av_assert0(lastInLumBuf + 1 - srcSliceY < srcSliceH);
             av_assert0(lastInLumBuf + 1 - srcSliceY >= 0);
 
-            //if (perform_gamma)
-            //    gamma_convert((uint8_t **)src1, srcW, c->inv_gamma);
+            if (perform_gamma)
+                gamma_convert((uint8_t **)src1, srcW, c->inv_gamma);
 
             hyscale(c, lumPixBuf[lumBufIndex], dstW, src1, srcW, lumXInc,
                     hLumFilter, hLumFilterPos, hLumFilterSize,
@@ -783,9 +784,9 @@ static int swscale(SwsContext *c, const uint8_t *src[],
                          chrUSrcPtr, chrVSrcPtr, vChrFilterSize,
                          alpSrcPtr, dest, dstW, dstY);
             }
+            if (perform_gamma)
+                gamma_convert(dest, dstW, c->gamma);
 #endif
-            //if (perform_gamma)
-            //    gamma_convert(dest, dstW, c->gamma);
         }
     }
     if (isPlanar(dstFormat) && isALPHA(dstFormat) && !alpPixBuf) {