Go to the documentation of this file.
37 #define CCP_VLC_BITS 5
38 #define DC_CCP_VLC_BITS 4
39 #define AC_CCP_VLC_BITS 6
40 #define ASV1_LEVEL_VLC_BITS 4
41 #define ASV2_LEVEL_VLC_BITS 10
113 for (
i = 0;
i < 11;
i++) {
119 if (ccp < 0 || i >= 10) {
156 for (
i = 1;
i < count + 1;
i++) {
178 a->bdsp.clear_blocks(
block[0]);
181 for (
i = 0;
i < 6;
i++) {
186 for (
i = 0;
i < 6;
i++) {
196 int16_t(*
block)[64] =
a->block;
197 int linesize =
frame->linesize[0];
199 uint8_t *dest_y =
frame->data[0] + (mb_y * 16 * linesize) + mb_x * 16;
200 uint8_t *dest_cb =
frame->data[1] + (mb_y * 8 *
frame->linesize[1]) + mb_x * 8;
201 uint8_t *dest_cr =
frame->data[2] + (mb_y * 8 *
frame->linesize[2]) + mb_x * 8;
203 a->idsp.idct_put(dest_y, linesize,
block[0]);
204 a->idsp.idct_put(dest_y + 8, linesize,
block[1]);
205 a->idsp.idct_put(dest_y + 8 * linesize, linesize,
block[2]);
206 a->idsp.idct_put(dest_y + 8 * linesize + 8, linesize,
block[3]);
209 a->idsp.idct_put(dest_cb,
frame->linesize[1],
block[4]);
210 a->idsp.idct_put(dest_cr,
frame->linesize[2],
block[5]);
218 const uint8_t *buf = avpkt->
data;
219 int buf_size = avpkt->
size;
223 if (buf_size * 8LL < a->mb_height *
a->mb_width * 13LL)
234 if (!
a->bitstream_buffer)
237 a->bbdsp.bswap_buf((uint32_t *)
a->bitstream_buffer,
238 (
const uint32_t *) buf, buf_size / 4);
246 for (mb_y = 0; mb_y <
a->mb_height2; mb_y++) {
247 for (mb_x = 0; mb_x <
a->mb_width2; mb_x++) {
255 if (
a->mb_width2 !=
a->mb_width) {
257 for (mb_y = 0; mb_y <
a->mb_height2; mb_y++) {
265 if (
a->mb_height2 !=
a->mb_height) {
266 mb_y =
a->mb_height2;
267 for (mb_x = 0; mb_x <
a->mb_width; mb_x++) {
307 for (
i = 0;
i < 64;
i++) {
324 a->bitstream_buffer_size = 0;
329 #if CONFIG_ASV1_DECODER
344 #if CONFIG_ASV2_DECODER
static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
#define AV_LOG_WARNING
Something somehow does not look correct.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
const uint8_t ff_asv_dc_ccp_tab[8][2]
const AVCodec ff_asv2_decoder
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
const AVCodec ff_asv1_decoder
const uint8_t ff_asv_level_tab[7][2]
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)
#define ASV2_LEVEL_VLC_BITS
static int get_bits_count(const GetBitContext *s)
static av_cold int decode_init(AVCodecContext *avctx)
This structure describes decoded (raw) audio or video data.
static const uint16_t table[]
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
static int asv2_get_vlc2(GetBitContext *gb, VLC_TYPE(*table)[2], int bits)
const uint16_t ff_asv2_level_tab[63][2]
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
const uint8_t ff_asv_scantab[64]
static int asv2_get_level(GetBitContext *gb)
int key_frame
1 -> keyframe, 0-> not
static av_always_inline float scale(float x, float s)
static int asv2_decode_block(ASV1Context *a, int16_t block[64])
static int ff_thread_once(char *control, void(*routine)(void))
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
#define ASV1_LEVEL_VLC_BITS
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
#define CLOSE_READER(name, gb)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
static unsigned int get_bits_le(GetBitContext *s, int n)
static int get_sbits(GetBitContext *s, int n)
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
#define SHOW_UBITS_LE(name, gb, num)
const uint8_t ff_asv_ac_ccp_tab[16][2]
@ AV_PICTURE_TYPE_I
Intra.
static av_cold void init_vlcs(void)
#define LAST_SKIP_BITS(name, gb, num)
static VLC asv2_level_vlc
enum AVPictureType pict_type
Picture type of the frame.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
const uint16_t ff_mpeg1_default_intra_matrix[256]
#define OPEN_READER(name, gb)
av_cold void ff_asv_common_init(AVCodecContext *avctx)
The reader does not expect b to be semantically here and if the code is changed by maybe adding a a division or other the signedness will almost certainly be mistaken To avoid this confusion a new type was SUINT is the C unsigned type but it holds a signed int to use the same example SUINT a
static int decode_mb(ASV1Context *a, int16_t block[6][64])
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional AV_INPUT_BUFFER_PADDING_SIZE at the end w...
av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
const char * name
Name of the codec implementation.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
static void idct_put(ASV1Context *a, AVFrame *frame, int mb_x, int mb_y)
main external API structure.
#define UPDATE_CACHE_LE(name, gb)
static av_cold int decode_end(AVCodecContext *avctx)
static int asv1_decode_block(ASV1Context *a, int16_t block[64])
static int init_get_bits8_le(GetBitContext *s, const uint8_t *buffer, int byte_size)
const uint8_t ff_asv_ccp_tab[17][2]
This structure stores compressed data.
The exact code depends on how similar the blocks are and how related they are to the block
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
av_cold void ff_blockdsp_init(BlockDSPContext *c, AVCodecContext *avctx)
static int asv1_get_level(GetBitContext *gb)
#define INIT_LE_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)
VLC_TYPE(* table)[2]
code, bits