[FFmpeg-trac] #3495(swscale:new): Call to sws_getCachedContext() with SWS_BICUBLIN will always raise an assert exception

FFmpeg trac at avcodec.org
Tue Mar 25 14:01:43 CET 2014


#3495: Call to sws_getCachedContext() with SWS_BICUBLIN will always raise an
assert exception
------------------------------------+-----------------------------------
             Reporter:  cyril       |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  important   |                Component:  swscale
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |
------------------------------------+-----------------------------------

Comment (by cyril):

 I already explained how to reproduce the bug programmatically:
 {{{
 #include <libswscale/swscale.h>
 void main() {
     SwsContext *pSwsContext = NULL;
     sws_getCachedContext(pSwsContext,
             720, 406,AV_PIX_FMT_YUV420P,
             256, 144, AV_PIX_FMT_BGRA,
             SWS_BICUBLIN, NULL, NULL, NULL
         );
 }
 }}}

 I don't know how to send a patch, but in libswscale/utils.c, replace the
 below lines:
 {{{
 281 static const ScaleAlgorithm scale_algorithms[] = {
 282     { SWS_AREA,          "area averaging",                  1 /*
 downscale only, for upscale it is bilinear */ },
 283     { SWS_BICUBIC,       "bicubic",                         4 },
 284     { SWS_BICUBLIN,      "luma bicubic / chroma bilinear", -1 },
 285     { SWS_BILINEAR,      "bilinear",                        2 },
 286     { SWS_FAST_BILINEAR, "fast bilinear",                  -1 },
 287     { SWS_GAUSS,         "Gaussian",                        8 /*
 infinite ;) */ },
 288     { SWS_LANCZOS,       "Lanczos",                        -1 /*
 custom */ },
 289     { SWS_POINT,         "nearest neighbor / point",       -1 },
 290     { SWS_SINC,          "sinc",                           20 /*
 infinite ;) */ },
 291     { SWS_SPLINE,        "bicubic spline",                 20 /*
 infinite :)*/ },
 292     { SWS_X,             "experimental",                    8 },
 293 };
 }}}

 by

 {{{
 281 static const ScaleAlgorithm scale_algorithms[] = {
 282     { SWS_AREA,          "area averaging",                  1 /*
 downscale only, for upscale it is bilinear */ },
 283     { SWS_BICUBIC,       "bicubic",                         4 },
 284     { SWS_BILINEAR,      "bilinear",                        2 },
 285     { SWS_BICUBLIN,      "luma bicubic / chroma bilinear", -1 },
 286     { SWS_FAST_BILINEAR, "fast bilinear",                  -1 },
 287     { SWS_GAUSS,         "Gaussian",                        8 /*
 infinite ;) */ },
 288     { SWS_LANCZOS,       "Lanczos",                        -1 /*
 custom */ },
 289     { SWS_POINT,         "nearest neighbor / point",       -1 },
 290     { SWS_SINC,          "sinc",                           20 /*
 infinite ;) */ },
 291     { SWS_SPLINE,        "bicubic spline",                 20 /*
 infinite :)*/ },
 292     { SWS_X,             "experimental",                    8 },
 293 };
 }}}

--
Ticket URL: <https://trac.ffmpeg.org/ticket/3495#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list