FFmpeg  4.3
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
webp.c File Reference
#include "libavutil/imgutils.h"
#include "avcodec.h"
#include "bytestream.h"
#include "exif.h"
#include "get_bits.h"
#include "internal.h"
#include "thread.h"
#include "vp8.h"

Go to the source code of this file.

Data Structures

struct  HuffReader
 
struct  ImageContext
 
struct  WebPContext
 

Macros

#define BITSTREAM_READER_LE
 
#define VP8X_FLAG_ANIMATION   0x02
 
#define VP8X_FLAG_XMP_METADATA   0x04
 
#define VP8X_FLAG_EXIF_METADATA   0x08
 
#define VP8X_FLAG_ALPHA   0x10
 
#define VP8X_FLAG_ICC   0x20
 
#define MAX_PALETTE_SIZE   256
 
#define MAX_CACHE_BITS   11
 
#define NUM_CODE_LENGTH_CODES   19
 
#define HUFFMAN_CODES_PER_META_CODE   5
 
#define NUM_LITERAL_CODES   256
 
#define NUM_LENGTH_CODES   24
 
#define NUM_DISTANCE_CODES   40
 
#define NUM_SHORT_DISTANCES   120
 
#define MAX_HUFFMAN_CODE_LENGTH   15
 
#define GET_PIXEL(frame, x, y)   ((frame)->data[0] + (y) * frame->linesize[0] + 4 * (x))
 
#define GET_PIXEL_COMP(frame, x, y, c)   (*((frame)->data[0] + (y) * frame->linesize[0] + 4 * (x) + c))
 
#define PARSE_BLOCK_SIZE(w, h)
 

Typedefs

typedef void(* inv_predict_func) (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 

Enumerations

enum  AlphaCompression { ALPHA_COMPRESSION_NONE, ALPHA_COMPRESSION_VP8L }
 
enum  AlphaFilter { ALPHA_FILTER_NONE, ALPHA_FILTER_HORIZONTAL, ALPHA_FILTER_VERTICAL, ALPHA_FILTER_GRADIENT }
 
enum  TransformType { PREDICTOR_TRANSFORM = 0, COLOR_TRANSFORM = 1, SUBTRACT_GREEN = 2, COLOR_INDEXING_TRANSFORM = 3 }
 
enum  PredictionMode {
  PRED_MODE_BLACK, PRED_MODE_L, PRED_MODE_T, PRED_MODE_TR,
  PRED_MODE_TL, PRED_MODE_AVG_T_AVG_L_TR, PRED_MODE_AVG_L_TL, PRED_MODE_AVG_L_T,
  PRED_MODE_AVG_TL_T, PRED_MODE_AVG_T_TR, PRED_MODE_AVG_AVG_L_TL_AVG_T_TR, PRED_MODE_SELECT,
  PRED_MODE_ADD_SUBTRACT_FULL, PRED_MODE_ADD_SUBTRACT_HALF
}
 
enum  HuffmanIndex {
  HUFF_IDX_GREEN = 0, HUFF_IDX_RED = 1, HUFF_IDX_BLUE = 2, HUFF_IDX_ALPHA = 3,
  HUFF_IDX_DIST = 4
}
 
enum  ImageRole {
  IMAGE_ROLE_ARGB, IMAGE_ROLE_ENTROPY, IMAGE_ROLE_PREDICTOR, IMAGE_ROLE_COLOR_TRANSFORM,
  IMAGE_ROLE_COLOR_INDEXING, IMAGE_ROLE_NB
}
 

Functions

static void image_ctx_free (ImageContext *img)
 
static av_always_inline int webp_get_vlc (GetBitContext *gb, VLC_TYPE(*table)[2])
 
static int huff_reader_get_symbol (HuffReader *r, GetBitContext *gb)
 
static int huff_reader_build_canonical (HuffReader *r, int *code_lengths, int alphabet_size)
 
static void read_huffman_code_simple (WebPContext *s, HuffReader *hc)
 
static int read_huffman_code_normal (WebPContext *s, HuffReader *hc, int alphabet_size)
 
static int decode_entropy_coded_image (WebPContext *s, enum ImageRole role, int w, int h)
 
static int decode_entropy_image (WebPContext *s)
 
static int parse_transform_predictor (WebPContext *s)
 
static int parse_transform_color (WebPContext *s)
 
static int parse_transform_color_indexing (WebPContext *s)
 
static HuffReaderget_huffman_group (WebPContext *s, ImageContext *img, int x, int y)
 
static av_always_inline void color_cache_put (ImageContext *img, uint32_t c)
 
static void inv_predict_0 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_1 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_2 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_3 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_4 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_5 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_6 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_7 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_8 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_9 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_10 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_11 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inv_predict_12 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static av_always_inline uint8_t clamp_add_subtract_half (int a, int b, int c)
 
static void inv_predict_13 (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
 
static void inverse_prediction (AVFrame *frame, enum PredictionMode m, int x, int y)
 
static int apply_predictor_transform (WebPContext *s)
 
static av_always_inline uint8_t color_transform_delta (uint8_t color_pred, uint8_t color)
 
static int apply_color_transform (WebPContext *s)
 
static int apply_subtract_green_transform (WebPContext *s)
 
static int apply_color_indexing_transform (WebPContext *s)
 
static void update_canvas_size (AVCodecContext *avctx, int w, int h)
 
static int vp8_lossless_decode_frame (AVCodecContext *avctx, AVFrame *p, int *got_frame, uint8_t *data_start, unsigned int data_size, int is_alpha_chunk)
 
static void alpha_inverse_prediction (AVFrame *frame, enum AlphaFilter m)
 
static int vp8_lossy_decode_alpha (AVCodecContext *avctx, AVFrame *p, uint8_t *data_start, unsigned int data_size)
 
static int vp8_lossy_decode_frame (AVCodecContext *avctx, AVFrame *p, int *got_frame, uint8_t *data_start, unsigned int data_size)
 
static int webp_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int webp_decode_close (AVCodecContext *avctx)
 

Variables

static const uint16_t alphabet_sizes [HUFFMAN_CODES_PER_META_CODE]
 
static const uint8_t code_length_code_order [NUM_CODE_LENGTH_CODES]
 
static const int8_t lz77_distance_offsets [NUM_SHORT_DISTANCES][2]
 
static const inv_predict_func inverse_predict [14]
 
AVCodec ff_webp_decoder
 

Detailed Description

WebP image decoder

Author
Aneesh Dogra anees.nosp@m.h@su.nosp@m.garla.nosp@m.bs.o.nosp@m.rg Container and Lossy decoding
Justin Ruggles justi.nosp@m.n.ru.nosp@m.ggles.nosp@m.@gma.nosp@m.il.co.nosp@m.m Lossless decoder Compressed alpha for lossy
James Almer jamri.nosp@m.al@g.nosp@m.mail..nosp@m.com Exif metadata ICC profile

Unimplemented:

Definition in file webp.c.

Macro Definition Documentation

◆ BITSTREAM_READER_LE

#define BITSTREAM_READER_LE

Definition at line 45 of file webp.c.

◆ VP8X_FLAG_ANIMATION

#define VP8X_FLAG_ANIMATION   0x02

Definition at line 54 of file webp.c.

◆ VP8X_FLAG_XMP_METADATA

#define VP8X_FLAG_XMP_METADATA   0x04

Definition at line 55 of file webp.c.

◆ VP8X_FLAG_EXIF_METADATA

#define VP8X_FLAG_EXIF_METADATA   0x08

Definition at line 56 of file webp.c.

◆ VP8X_FLAG_ALPHA

#define VP8X_FLAG_ALPHA   0x10

Definition at line 57 of file webp.c.

◆ VP8X_FLAG_ICC

#define VP8X_FLAG_ICC   0x20

Definition at line 58 of file webp.c.

◆ MAX_PALETTE_SIZE

#define MAX_PALETTE_SIZE   256

Definition at line 60 of file webp.c.

◆ MAX_CACHE_BITS

#define MAX_CACHE_BITS   11

Definition at line 61 of file webp.c.

◆ NUM_CODE_LENGTH_CODES

#define NUM_CODE_LENGTH_CODES   19

Definition at line 62 of file webp.c.

◆ HUFFMAN_CODES_PER_META_CODE

#define HUFFMAN_CODES_PER_META_CODE   5

Definition at line 63 of file webp.c.

◆ NUM_LITERAL_CODES

#define NUM_LITERAL_CODES   256

Definition at line 64 of file webp.c.

◆ NUM_LENGTH_CODES

#define NUM_LENGTH_CODES   24

Definition at line 65 of file webp.c.

◆ NUM_DISTANCE_CODES

#define NUM_DISTANCE_CODES   40

Definition at line 66 of file webp.c.

◆ NUM_SHORT_DISTANCES

#define NUM_SHORT_DISTANCES   120

Definition at line 67 of file webp.c.

◆ MAX_HUFFMAN_CODE_LENGTH

#define MAX_HUFFMAN_CODE_LENGTH   15

Definition at line 68 of file webp.c.

◆ GET_PIXEL

#define GET_PIXEL (   frame,
  x,
 
)    ((frame)->data[0] + (y) * frame->linesize[0] + 4 * (x))

Definition at line 212 of file webp.c.

◆ GET_PIXEL_COMP

#define GET_PIXEL_COMP (   frame,
  x,
  y,
  c 
)    (*((frame)->data[0] + (y) * frame->linesize[0] + 4 * (x) + c))

Definition at line 215 of file webp.c.

◆ PARSE_BLOCK_SIZE

#define PARSE_BLOCK_SIZE (   w,
  h 
)
Value:
do { \
block_bits = get_bits(&s->gb, 3) + 2; \
blocks_w = FFALIGN((w), 1 << block_bits) >> block_bits; \
blocks_h = FFALIGN((h), 1 << block_bits) >> block_bits; \
} while (0)

Definition at line 457 of file webp.c.

Typedef Documentation

◆ inv_predict_func

typedef void(* inv_predict_func) (uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)

Definition at line 923 of file webp.c.

Enumeration Type Documentation

◆ AlphaCompression

Enumerator
ALPHA_COMPRESSION_NONE 
ALPHA_COMPRESSION_VP8L 

Definition at line 98 of file webp.c.

◆ AlphaFilter

Enumerator
ALPHA_FILTER_NONE 
ALPHA_FILTER_HORIZONTAL 
ALPHA_FILTER_VERTICAL 
ALPHA_FILTER_GRADIENT 

Definition at line 103 of file webp.c.

◆ TransformType

Enumerator
PREDICTOR_TRANSFORM 
COLOR_TRANSFORM 
SUBTRACT_GREEN 
COLOR_INDEXING_TRANSFORM 

Definition at line 110 of file webp.c.

◆ PredictionMode

Enumerator
PRED_MODE_BLACK 
PRED_MODE_L 
PRED_MODE_T 
PRED_MODE_TR 
PRED_MODE_TL 
PRED_MODE_AVG_T_AVG_L_TR 
PRED_MODE_AVG_L_TL 
PRED_MODE_AVG_L_T 
PRED_MODE_AVG_TL_T 
PRED_MODE_AVG_T_TR 
PRED_MODE_AVG_AVG_L_TL_AVG_T_TR 
PRED_MODE_SELECT 
PRED_MODE_ADD_SUBTRACT_FULL 
PRED_MODE_ADD_SUBTRACT_HALF 

Definition at line 117 of file webp.c.

◆ HuffmanIndex

Enumerator
HUFF_IDX_GREEN 
HUFF_IDX_RED 
HUFF_IDX_BLUE 
HUFF_IDX_ALPHA 
HUFF_IDX_DIST 

Definition at line 134 of file webp.c.

◆ ImageRole

enum ImageRole
Enumerator
IMAGE_ROLE_ARGB 
IMAGE_ROLE_ENTROPY 
IMAGE_ROLE_PREDICTOR 
IMAGE_ROLE_COLOR_TRANSFORM 
IMAGE_ROLE_COLOR_INDEXING 
IMAGE_ROLE_NB 

Definition at line 148 of file webp.c.

Function Documentation

◆ image_ctx_free()

static void image_ctx_free ( ImageContext img)
static

Definition at line 218 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ webp_get_vlc()

static av_always_inline int webp_get_vlc ( GetBitContext gb,
VLC_TYPE(*)  table[2] 
)
static

Definition at line 241 of file webp.c.

Referenced by huff_reader_get_symbol().

◆ huff_reader_get_symbol()

static int huff_reader_get_symbol ( HuffReader r,
GetBitContext gb 
)
static

Definition at line 273 of file webp.c.

Referenced by decode_entropy_coded_image(), and read_huffman_code_normal().

◆ huff_reader_build_canonical()

static int huff_reader_build_canonical ( HuffReader r,
int code_lengths,
int  alphabet_size 
)
static

Definition at line 284 of file webp.c.

Referenced by read_huffman_code_normal().

◆ read_huffman_code_simple()

static void read_huffman_code_simple ( WebPContext s,
HuffReader hc 
)
static

Definition at line 346 of file webp.c.

Referenced by decode_entropy_coded_image().

◆ read_huffman_code_normal()

static int read_huffman_code_normal ( WebPContext s,
HuffReader hc,
int  alphabet_size 
)
static

Definition at line 361 of file webp.c.

Referenced by decode_entropy_coded_image().

◆ decode_entropy_coded_image()

static int decode_entropy_coded_image ( WebPContext s,
enum ImageRole  role,
int  w,
int  h 
)
static

◆ decode_entropy_image()

static int decode_entropy_image ( WebPContext s)
static

Definition at line 463 of file webp.c.

Referenced by decode_entropy_coded_image().

◆ parse_transform_predictor()

static int parse_transform_predictor ( WebPContext s)
static

Definition at line 497 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ parse_transform_color()

static int parse_transform_color ( WebPContext s)
static

Definition at line 513 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ parse_transform_color_indexing()

static int parse_transform_color_indexing ( WebPContext s)
static

Definition at line 529 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ get_huffman_group()

static HuffReader* get_huffman_group ( WebPContext s,
ImageContext img,
int  x,
int  y 
)
static

Definition at line 564 of file webp.c.

Referenced by decode_entropy_coded_image().

◆ color_cache_put()

static av_always_inline void color_cache_put ( ImageContext img,
uint32_t  c 
)
static

Definition at line 581 of file webp.c.

Referenced by decode_entropy_coded_image().

◆ inv_predict_0()

static void inv_predict_0 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 789 of file webp.c.

◆ inv_predict_1()

static void inv_predict_1 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 796 of file webp.c.

◆ inv_predict_2()

static void inv_predict_2 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 803 of file webp.c.

◆ inv_predict_3()

static void inv_predict_3 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 810 of file webp.c.

◆ inv_predict_4()

static void inv_predict_4 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 817 of file webp.c.

◆ inv_predict_5()

static void inv_predict_5 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 824 of file webp.c.

◆ inv_predict_6()

static void inv_predict_6 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 834 of file webp.c.

◆ inv_predict_7()

static void inv_predict_7 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 844 of file webp.c.

◆ inv_predict_8()

static void inv_predict_8 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 854 of file webp.c.

◆ inv_predict_9()

static void inv_predict_9 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 864 of file webp.c.

◆ inv_predict_10()

static void inv_predict_10 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 874 of file webp.c.

◆ inv_predict_11()

static void inv_predict_11 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 884 of file webp.c.

◆ inv_predict_12()

static void inv_predict_12 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 898 of file webp.c.

◆ clamp_add_subtract_half()

static av_always_inline uint8_t clamp_add_subtract_half ( int  a,
int  b,
int  c 
)
static

Definition at line 907 of file webp.c.

Referenced by inv_predict_13().

◆ inv_predict_13()

static void inv_predict_13 ( uint8_t p,
const uint8_t p_l,
const uint8_t p_tl,
const uint8_t p_t,
const uint8_t p_tr 
)
static

Definition at line 914 of file webp.c.

◆ inverse_prediction()

static void inverse_prediction ( AVFrame frame,
enum PredictionMode  m,
int  x,
int  y 
)
static

Definition at line 934 of file webp.c.

Referenced by apply_predictor_transform().

◆ apply_predictor_transform()

static int apply_predictor_transform ( WebPContext s)
static

Definition at line 956 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ color_transform_delta()

static av_always_inline uint8_t color_transform_delta ( uint8_t  color_pred,
uint8_t  color 
)
static

Definition at line 987 of file webp.c.

Referenced by apply_color_transform().

◆ apply_color_transform()

static int apply_color_transform ( WebPContext s)
static

Definition at line 993 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ apply_subtract_green_transform()

static int apply_subtract_green_transform ( WebPContext s)
static

Definition at line 1017 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ apply_color_indexing_transform()

static int apply_color_indexing_transform ( WebPContext s)
static

Definition at line 1032 of file webp.c.

Referenced by vp8_lossless_decode_frame().

◆ update_canvas_size()

static void update_canvas_size ( AVCodecContext avctx,
int  w,
int  h 
)
static

Definition at line 1103 of file webp.c.

Referenced by vp8_lossless_decode_frame(), and vp8_lossy_decode_frame().

◆ vp8_lossless_decode_frame()

static int vp8_lossless_decode_frame ( AVCodecContext avctx,
AVFrame p,
int got_frame,
uint8_t data_start,
unsigned int  data_size,
int  is_alpha_chunk 
)
static

Definition at line 1118 of file webp.c.

Referenced by vp8_lossy_decode_alpha(), and webp_decode_frame().

◆ alpha_inverse_prediction()

static void alpha_inverse_prediction ( AVFrame frame,
enum AlphaFilter  m 
)
static

Definition at line 1231 of file webp.c.

Referenced by vp8_lossy_decode_alpha().

◆ vp8_lossy_decode_alpha()

static int vp8_lossy_decode_alpha ( AVCodecContext avctx,
AVFrame p,
uint8_t data_start,
unsigned int  data_size 
)
static

Definition at line 1274 of file webp.c.

Referenced by vp8_lossy_decode_frame().

◆ vp8_lossy_decode_frame()

static int vp8_lossy_decode_frame ( AVCodecContext avctx,
AVFrame p,
int got_frame,
uint8_t data_start,
unsigned int  data_size 
)
static

Definition at line 1327 of file webp.c.

Referenced by webp_decode_frame().

◆ webp_decode_frame()

static int webp_decode_frame ( AVCodecContext avctx,
void data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 1370 of file webp.c.

◆ webp_decode_close()

static av_cold int webp_decode_close ( AVCodecContext avctx)
static

Definition at line 1569 of file webp.c.

Variable Documentation

◆ alphabet_sizes

const uint16_t alphabet_sizes[HUFFMAN_CODES_PER_META_CODE]
static

◆ code_length_code_order

const uint8_t code_length_code_order[NUM_CODE_LENGTH_CODES]
static
Initial value:
= {
17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
}

Definition at line 76 of file webp.c.

Referenced by read_huffman_code_normal().

◆ lz77_distance_offsets

const int8_t lz77_distance_offsets[NUM_SHORT_DISTANCES][2]
static
Initial value:
= {
{ 0, 1 }, { 1, 0 }, { 1, 1 }, { -1, 1 }, { 0, 2 }, { 2, 0 }, { 1, 2 }, { -1, 2 },
{ 2, 1 }, { -2, 1 }, { 2, 2 }, { -2, 2 }, { 0, 3 }, { 3, 0 }, { 1, 3 }, { -1, 3 },
{ 3, 1 }, { -3, 1 }, { 2, 3 }, { -2, 3 }, { 3, 2 }, { -3, 2 }, { 0, 4 }, { 4, 0 },
{ 1, 4 }, { -1, 4 }, { 4, 1 }, { -4, 1 }, { 3, 3 }, { -3, 3 }, { 2, 4 }, { -2, 4 },
{ 4, 2 }, { -4, 2 }, { 0, 5 }, { 3, 4 }, { -3, 4 }, { 4, 3 }, { -4, 3 }, { 5, 0 },
{ 1, 5 }, { -1, 5 }, { 5, 1 }, { -5, 1 }, { 2, 5 }, { -2, 5 }, { 5, 2 }, { -5, 2 },
{ 4, 4 }, { -4, 4 }, { 3, 5 }, { -3, 5 }, { 5, 3 }, { -5, 3 }, { 0, 6 }, { 6, 0 },
{ 1, 6 }, { -1, 6 }, { 6, 1 }, { -6, 1 }, { 2, 6 }, { -2, 6 }, { 6, 2 }, { -6, 2 },
{ 4, 5 }, { -4, 5 }, { 5, 4 }, { -5, 4 }, { 3, 6 }, { -3, 6 }, { 6, 3 }, { -6, 3 },
{ 0, 7 }, { 7, 0 }, { 1, 7 }, { -1, 7 }, { 5, 5 }, { -5, 5 }, { 7, 1 }, { -7, 1 },
{ 4, 6 }, { -4, 6 }, { 6, 4 }, { -6, 4 }, { 2, 7 }, { -2, 7 }, { 7, 2 }, { -7, 2 },
{ 3, 7 }, { -3, 7 }, { 7, 3 }, { -7, 3 }, { 5, 6 }, { -5, 6 }, { 6, 5 }, { -6, 5 },
{ 8, 0 }, { 4, 7 }, { -4, 7 }, { 7, 4 }, { -7, 4 }, { 8, 1 }, { 8, 2 }, { 6, 6 },
{ -6, 6 }, { 8, 3 }, { 5, 7 }, { -5, 7 }, { 7, 5 }, { -7, 5 }, { 8, 4 }, { 6, 7 },
{ -6, 7 }, { 7, 6 }, { -7, 6 }, { 8, 5 }, { 7, 7 }, { -7, 7 }, { 8, 6 }, { 8, 7 }
}

Definition at line 80 of file webp.c.

Referenced by decode_entropy_coded_image().

◆ inverse_predict

const inv_predict_func inverse_predict[14]
static

◆ ff_webp_decoder

AVCodec ff_webp_decoder
Initial value:
= {
.name = "webp",
.long_name = NULL_IF_CONFIG_SMALL("WebP image"),
.priv_data_size = sizeof(WebPContext),
}

Definition at line 1579 of file webp.c.

inv_predict_12
static void inv_predict_12(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:898
block_bits
static const uint8_t block_bits[]
Definition: imm4.c:106
inv_predict_4
static void inv_predict_4(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:817
inv_predict_2
static void inv_predict_2(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:803
inv_predict_10
static void inv_predict_10(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:874
webp_decode_frame
static int webp_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
Definition: webp.c:1370
get_bits
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
Definition: get_bits.h:379
inv_predict_8
static void inv_predict_8(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:854
inv_predict_3
static void inv_predict_3(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:810
decode
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
Definition: decode_audio.c:71
s
#define s(width, name)
Definition: cbs_vp9.c:257
NUM_DISTANCE_CODES
#define NUM_DISTANCE_CODES
Definition: webp.c:66
inv_predict_11
static void inv_predict_11(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:884
webp_decode_close
static av_cold int webp_decode_close(AVCodecContext *avctx)
Definition: webp.c:1569
AV_CODEC_CAP_FRAME_THREADS
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
Definition: codec.h:106
NUM_LITERAL_CODES
#define NUM_LITERAL_CODES
Definition: webp.c:64
inv_predict_0
static void inv_predict_0(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:789
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:50
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:186
inv_predict_5
static void inv_predict_5(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:824
NUM_LENGTH_CODES
#define NUM_LENGTH_CODES
Definition: webp.c:65
AV_CODEC_ID_WEBP
@ AV_CODEC_ID_WEBP
Definition: codec_id.h:221
inv_predict_7
static void inv_predict_7(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:844
inv_predict_13
static void inv_predict_13(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:914
w
FFmpeg Automated Testing Environment ************************************Introduction Using FATE from your FFmpeg source directory Submitting the results to the FFmpeg result aggregation server Uploading new samples to the fate suite FATE makefile targets and variables Makefile targets Makefile variables Examples Introduction **************FATE is an extended regression suite on the client side and a means for results aggregation and presentation on the server side The first part of this document explains how you can use FATE from your FFmpeg source directory to test your ffmpeg binary The second part describes how you can run FATE to submit the results to FFmpeg’s FATE server In any way you can have a look at the publicly viewable FATE results by visiting this as it can be seen if some test on some platform broke with their recent contribution This usually happens on the platforms the developers could not test on The second part of this document describes how you can run FATE to submit your results to FFmpeg’s FATE server If you want to submit your results be sure to check that your combination of OS and compiler is not already listed on the above mentioned website In the third part you can find a comprehensive listing of FATE makefile targets and variables Using FATE from your FFmpeg source directory **********************************************If you want to run FATE on your machine you need to have the samples in place You can get the samples via the build target fate rsync Use this command from the top level source this will cause FATE to fail NOTE To use a custom wrapper to run the pass ‘ target exec’ to ‘configure’ or set the TARGET_EXEC Make variable Submitting the results to the FFmpeg result aggregation server ****************************************************************To submit your results to the server you should run fate through the shell script ‘tests fate sh’ from the FFmpeg sources This script needs to be invoked with a configuration file as its first argument tests fate sh path to fate_config A configuration file template with comments describing the individual configuration variables can be found at ‘doc fate_config sh template’ Create a configuration that suits your based on the configuration template The ‘slot’ configuration variable can be any string that is not yet but it is suggested that you name it adhering to the following pattern ‘ARCH OS COMPILER COMPILER VERSION’ The configuration file itself will be sourced in a shell therefore all shell features may be used This enables you to setup the environment as you need it for your build For your first test runs the ‘fate_recv’ variable should be empty or commented out This will run everything as normal except that it will omit the submission of the results to the server The following files should be present in $workdir as specified in the configuration it may help to try out the ‘ssh’ command with one or more ‘ v’ options You should get detailed output concerning your SSH configuration and the authentication process The only thing left is to automate the execution of the fate sh script and the synchronisation of the samples directory Uploading new samples to the fate suite *****************************************If you need a sample uploaded send a mail to samples request This is for developers who have an account on the fate suite server If you upload new please make sure they are as small as space on each network bandwidth and so on benefit from smaller test cases Also keep in mind older checkouts use existing sample that means in practice generally do not remove or overwrite files as it likely would break older checkouts or releases Also all needed samples for a commit should be ideally before the push If you need an account for frequently uploading samples or you wish to help others by doing that send a mail to ffmpeg devel rsync vauL Duo ug o o w
Definition: fate.txt:150
inv_predict_6
static void inv_predict_6(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:834
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FFALIGN
#define FFALIGN(x, a)
Definition: macros.h:48
WebPContext
Definition: webp.c:188
h
h
Definition: vp9dsp_template.c:2038
inv_predict_9
static void inv_predict_9(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:864
inv_predict_1
static void inv_predict_1(uint8_t *p, const uint8_t *p_l, const uint8_t *p_tl, const uint8_t *p_t, const uint8_t *p_tr)
Definition: webp.c:796