go-libwebp

Experimental translation from libwebp to Go source.
Log | Files | Refs | README | LICENSE

sharpyuv_stub.c (1642B)


      1 // Stub replacements for libwebp's sharpyuv library, used by the transpiled
      2 // backend only.
      3 //
      4 // sharpyuv/sharpyuv_gamma.c is the only file in libwebp that calls expf() and
      5 // logf(), and modernc.org/libc provides Xexpf/Xlogf for linux targets only.
      6 // Transpiling sharpyuv therefore fails to link on darwin and windows.
      7 //
      8 // Nothing here is reachable: sharpyuv is entered only through
      9 // WebPConfig.use_sharp_yuv, and this package always encodes via
     10 // WebPEncodeRGBA / WebPEncodeLosslessRGBA, which use the default config.
     11 // SharpYuvConvert returning 0 is the library's own failure signal, so a
     12 // caller that did enable sharp YUV would get a clean encode error rather
     13 // than wrong output.
     14 
     15 #include "sharpyuv/sharpyuv.h"
     16 #include "sharpyuv/sharpyuv_csp.h"
     17 #include "src/dsp/cpu.h"
     18 
     19 void SharpYuvInit(VP8CPUInfo cpu_info_func) { (void)cpu_info_func; }
     20 
     21 const SharpYuvConversionMatrix* SharpYuvGetConversionMatrix(
     22     SharpYuvMatrixType matrix_type) {
     23   (void)matrix_type;
     24   return NULL;
     25 }
     26 
     27 int SharpYuvConvert(const void* r_ptr, const void* g_ptr, const void* b_ptr,
     28                     int rgb_step, int rgb_stride, int rgb_bit_depth,
     29                     void* y_ptr, int y_stride, void* u_ptr, int u_stride,
     30                     void* v_ptr, int v_stride, int yuv_bit_depth, int width,
     31                     int height, const SharpYuvConversionMatrix* yuv_matrix) {
     32   (void)r_ptr; (void)g_ptr; (void)b_ptr; (void)rgb_step; (void)rgb_stride;
     33   (void)rgb_bit_depth; (void)y_ptr; (void)y_stride; (void)u_ptr;
     34   (void)u_stride; (void)v_ptr; (void)v_stride; (void)yuv_bit_depth;
     35   (void)width; (void)height; (void)yuv_matrix;
     36   return 0;
     37 }