#include "avcodec.h"
#include "bitstream.h"
#include "dsputil.h"
#include "rangecoder.h"
#include "golomb.h"
#include "mathops.h"
Go to the source code of this file.
Data Structures | |
| struct | VlcState |
| struct | PlaneContext |
| struct | FFV1Context |
Defines | |
| #define | MAX_PLANES 4 |
| #define | CONTEXT_SIZE 32 |
Functions | |
| static av_always_inline int | fold (int diff, int bits) |
| static int | predict (int_fast16_t *src, int_fast16_t *last) |
| static int | get_context (FFV1Context *f, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2) |
| static void | put_symbol (RangeCoder *c, uint8_t *state, int v, int is_signed) |
| static int | get_symbol (RangeCoder *c, uint8_t *state, int is_signed) |
| static void | update_vlc_state (VlcState *const state, const int v) |
| static void | put_vlc_symbol (PutBitContext *pb, VlcState *const state, int v, int bits) |
| static int | get_vlc_symbol (GetBitContext *gb, VlcState *const state, int bits) |
| static av_cold int | common_init (AVCodecContext *avctx) |
| static void | clear_state (FFV1Context *f) |
| static av_cold int | common_end (AVCodecContext *avctx) |
| static void | decode_line (FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits) |
| static void | decode_plane (FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index) |
| static void | decode_rgb_frame (FFV1Context *s, uint32_t *src, int w, int h, int stride) |
| static int | read_quant_table (RangeCoder *c, int16_t *quant_table, int scale) |
| static int | read_header (FFV1Context *f) |
| static av_cold int | decode_init (AVCodecContext *avctx) |
| static int | decode_frame (AVCodecContext *avctx, void *data, int *data_size, const uint8_t *buf, int buf_size) |
Variables | |
| const uint8_t | ff_log2_run [32] |
| static const int8_t | quant3 [256] |
| static const int8_t | quant5 [256] |
| static const int8_t | quant7 [256] |
| static const int8_t | quant9 [256] |
| static const int8_t | quant11 [256] |
| static const int8_t | quant13 [256] |
| AVCodec | ffv1_decoder |
Definition in file ffv1.c.
| #define CONTEXT_SIZE 32 |
Definition at line 36 of file ffv1.c.
Referenced by clear_state(), read_header(), and read_quant_table().
| static void clear_state | ( | FFV1Context * | f | ) | [static] |
| static av_cold int common_end | ( | AVCodecContext * | avctx | ) | [static] |
| static av_cold int common_init | ( | AVCodecContext * | avctx | ) | [static] |
| static int decode_frame | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| const uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
| static av_cold int decode_init | ( | AVCodecContext * | avctx | ) | [static] |
| static void decode_line | ( | FFV1Context * | s, | |
| int | w, | |||
| int_fast16_t * | sample[2], | |||
| int | plane_index, | |||
| int | bits | |||
| ) | [inline, static] |
| static void decode_plane | ( | FFV1Context * | s, | |
| uint8_t * | src, | |||
| int | w, | |||
| int | h, | |||
| int | stride, | |||
| int | plane_index | |||
| ) | [static] |
| static void decode_rgb_frame | ( | FFV1Context * | s, | |
| uint32_t * | src, | |||
| int | w, | |||
| int | h, | |||
| int | stride | |||
| ) | [static] |
| static av_always_inline int fold | ( | int | diff, | |
| int | bits | |||
| ) | [static] |
| static int get_context | ( | FFV1Context * | f, | |
| int_fast16_t * | src, | |||
| int_fast16_t * | last, | |||
| int_fast16_t * | last2 | |||
| ) | [inline, static] |
| static int get_symbol | ( | RangeCoder * | c, | |
| uint8_t * | state, | |||
| int | is_signed | |||
| ) | [inline, static] |
Definition at line 245 of file ffv1.c.
Referenced by decode_header(), decode_line(), decode_q_branch(), decode_qlogs(), read_header(), and read_quant_table().
| static int get_vlc_symbol | ( | GetBitContext * | gb, | |
| VlcState *const | state, | |||
| int | bits | |||
| ) | [inline, static] |
| static int predict | ( | int_fast16_t * | src, | |
| int_fast16_t * | last | |||
| ) | [inline, static] |
| static void put_symbol | ( | RangeCoder * | c, | |
| uint8_t * | state, | |||
| int | v, | |||
| int | is_signed | |||
| ) | [inline, static] |
Definition at line 219 of file ffv1.c.
Referenced by encode_header(), encode_q_branch(), encode_q_branch2(), and encode_qlogs().
| static void put_vlc_symbol | ( | PutBitContext * | pb, | |
| VlcState *const | state, | |||
| int | v, | |||
| int | bits | |||
| ) | [inline, static] |
| static int read_header | ( | FFV1Context * | f | ) | [static] |
| static int read_quant_table | ( | RangeCoder * | c, | |
| int16_t * | quant_table, | |||
| int | scale | |||
| ) | [static] |
| static void update_vlc_state | ( | VlcState *const | state, | |
| const int | v | |||
| ) | [inline, static] |
| const uint8_t ff_log2_run[32] |
Definition at line 33 of file bitstream.c.
Initial value:
{
"ffv1",
CODEC_TYPE_VIDEO,
CODEC_ID_FFV1,
sizeof(FFV1Context),
decode_init,
NULL,
common_end,
decode_frame,
CODEC_CAP_DR1 ,
NULL,
.long_name= NULL_IF_CONFIG_SMALL("FFmpeg codec #1"),
}
const int8_t quant11[256] [static] |
Initial value:
{
0, 1, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,
-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-5,-4,-4,
-4,-4,-4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