SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,
                                float lumaSharpen, float chromaSharpen,
                                float chromaHShift, float chromaVShift,
                                int verbose)
{
    SwsFilter *filter= av_malloc(sizeof(SwsFilter));
    if (lumaGBlur!=0.0){
        filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);
        filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);
    }else{
        filter->lumH= sws_getIdentityVec();
        filter->lumV= sws_getIdentityVec();
    }
    if (chromaGBlur!=0.0){
        filter->chrH= sws_getGaussianVec(chromaGBlur, 3.0);
        filter->chrV= sws_getGaussianVec(chromaGBlur, 3.0);
    }else{
        filter->chrH= sws_getIdentityVec();
        filter->chrV= sws_getIdentityVec();
    }
    if (chromaSharpen!=0.0){
        SwsVector *id= sws_getIdentityVec();
        sws_scaleVec(filter->chrH, -chromaSharpen);
        sws_scaleVec(filter->chrV, -chromaSharpen);
        sws_addVec(filter->chrH, id);
        sws_addVec(filter->chrV, id);
        sws_freeVec(id);
    }
    if (lumaSharpen!=0.0){
        SwsVector *id= sws_getIdentityVec();
        sws_scaleVec(filter->lumH, -lumaSharpen);
        sws_scaleVec(filter->lumV, -lumaSharpen);
        sws_addVec(filter->lumH, id);
        sws_addVec(filter->lumV, id);
        sws_freeVec(id);
    }
    if (chromaHShift != 0.0)
        sws_shiftVec(filter->chrH, (int)(chromaHShift+0.5));
    if (chromaVShift != 0.0)
        sws_shiftVec(filter->chrV, (int)(chromaVShift+0.5));
    sws_normalizeVec(filter->chrH, 1.0);
    sws_normalizeVec(filter->chrV, 1.0);
    sws_normalizeVec(filter->lumH, 1.0);
    sws_normalizeVec(filter->lumV, 1.0);
    if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG);
    if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG);
    return filter;
}
['SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur,\n                                float lumaSharpen, float chromaSharpen,\n                                float chromaHShift, float chromaVShift,\n                                int verbose)\n{\n    SwsFilter *filter= av_malloc(sizeof(SwsFilter));\n    if (lumaGBlur!=0.0){\n        filter->lumH= sws_getGaussianVec(lumaGBlur, 3.0);\n        filter->lumV= sws_getGaussianVec(lumaGBlur, 3.0);\n    }else{\n        filter->lumH= sws_getIdentityVec();\n        filter->lumV= sws_getIdentityVec();\n    }\n    if (chromaGBlur!=0.0){\n        filter->chrH= sws_getGaussianVec(chromaGBlur, 3.0);\n        filter->chrV= sws_getGaussianVec(chromaGBlur, 3.0);\n    }else{\n        filter->chrH= sws_getIdentityVec();\n        filter->chrV= sws_getIdentityVec();\n    }\n    if (chromaSharpen!=0.0){\n        SwsVector *id= sws_getIdentityVec();\n        sws_scaleVec(filter->chrH, -chromaSharpen);\n        sws_scaleVec(filter->chrV, -chromaSharpen);\n        sws_addVec(filter->chrH, id);\n        sws_addVec(filter->chrV, id);\n        sws_freeVec(id);\n    }\n    if (lumaSharpen!=0.0){\n        SwsVector *id= sws_getIdentityVec();\n        sws_scaleVec(filter->lumH, -lumaSharpen);\n        sws_scaleVec(filter->lumV, -lumaSharpen);\n        sws_addVec(filter->lumH, id);\n        sws_addVec(filter->lumV, id);\n        sws_freeVec(id);\n    }\n    if (chromaHShift != 0.0)\n        sws_shiftVec(filter->chrH, (int)(chromaHShift+0.5));\n    if (chromaVShift != 0.0)\n        sws_shiftVec(filter->chrV, (int)(chromaVShift+0.5));\n    sws_normalizeVec(filter->chrH, 1.0);\n    sws_normalizeVec(filter->chrV, 1.0);\n    sws_normalizeVec(filter->lumH, 1.0);\n    sws_normalizeVec(filter->lumV, 1.0);\n    if (verbose) sws_printVec2(filter->chrH, NULL, AV_LOG_DEBUG);\n    if (verbose) sws_printVec2(filter->lumH, NULL, AV_LOG_DEBUG);\n    return filter;\n}', 'void *av_malloc(unsigned int size)\n{\n    void *ptr = NULL;\n#if CONFIG_MEMALIGN_HACK\n    long diff;\n#endif\n    if(size > (INT_MAX-16) )\n        return NULL;\n#if CONFIG_MEMALIGN_HACK\n    ptr = malloc(size+16);\n    if(!ptr)\n        return ptr;\n    diff= ((-(long)ptr - 1)&15) + 1;\n    ptr = (char*)ptr + diff;\n    ((char*)ptr)[-1]= diff;\n#elif HAVE_POSIX_MEMALIGN\n    if (posix_memalign(&ptr,16,size))\n        ptr = NULL;\n#elif HAVE_MEMALIGN\n    ptr = memalign(16,size);\n#else\n    ptr = malloc(size);\n#endif\n    return ptr;\n}']