Go to the documentation of this file.
63 if (level < -128 || level > 127) {
79 for (
i = 0;
i < 10;
i++) {
84 a->q_intra_matrix[
index + 0] + (1 << 15)) >> 16))
87 a->q_intra_matrix[
index + 8] + (1 << 15)) >> 16))
90 a->q_intra_matrix[
index + 1] + (1 << 15)) >> 16))
93 a->q_intra_matrix[
index + 9] + (1 << 15)) >> 16))
97 for (; nc_count; nc_count--)
122 for (count = 63; count > 3; count--) {
134 for (
i = 0;
i <= count;
i++) {
139 a->q_intra_matrix[
index + 0] + (1 << 15)) >> 16))
142 a->q_intra_matrix[
index + 8] + (1 << 15)) >> 16))
145 a->q_intra_matrix[
index + 1] + (1 << 15)) >> 16))
148 a->q_intra_matrix[
index + 9] + (1 << 15)) >> 16))
170 #define MAX_MB_SIZE (30 * 16 * 16 * 3 / 2 / 8)
179 for (
i = 0;
i < 6;
i++)
182 for (
i = 0;
i < 6;
i++) {
192 int16_t (*
block)[64] =
a->block;
193 int linesize =
frame->linesize[0];
196 uint8_t *ptr_y =
frame->data[0] + (mb_y * 16 * linesize) + mb_x * 16;
200 a->pdsp.get_pixels(
block[0], ptr_y, linesize);
201 a->pdsp.get_pixels(
block[1], ptr_y + 8, linesize);
202 a->pdsp.get_pixels(
block[2], ptr_y + 8 * linesize, linesize);
203 a->pdsp.get_pixels(
block[3], ptr_y + 8 * linesize + 8, linesize);
204 for (
i = 0;
i < 4;
i++)
208 a->pdsp.get_pixels(
block[4], ptr_cb,
frame->linesize[1]);
209 a->pdsp.get_pixels(
block[5], ptr_cr,
frame->linesize[2]);
210 for (
i = 4;
i < 6;
i++)
216 const AVFrame *pict,
int *got_packet)
243 for (
i = 0;
i<3;
i++) {
270 for (mb_y = 0; mb_y <
a->mb_height2; mb_y++) {
271 for (mb_x = 0; mb_x <
a->mb_width2; mb_x++) {
277 if (
a->mb_width2 !=
a->mb_width) {
279 for (mb_y = 0; mb_y <
a->mb_height2; mb_y++) {
285 if (
a->mb_height2 !=
a->mb_height) {
286 mb_y =
a->mb_height2;
287 for (mb_x = 0; mb_x <
a->mb_width; mb_x++) {
301 a->bbdsp.bswap_buf((uint32_t *)
pkt->
data,
339 for (
i = 0;
i < 64;
i++) {
342 a->q_intra_matrix[
i] = (((int64_t)
a->inv_qscale << 30) + q / 2) / q;
345 a->q_intra_matrix[
i] = ((
a->inv_qscale << 16) + q / 2) / q;
352 #if CONFIG_ASV1_ENCODER
367 #if CONFIG_ASV2_ENCODER
const uint8_t ff_asv2_level_tab[63][2]
#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]
AVPixelFormat
Pixel format.
static void asv2_put_bits(PutBitContext *pb, int n, int v)
static void asv1_put_level(PutBitContext *pb, int level)
static av_cold int init(AVCodecContext *avctx)
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
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
static void put_sbits(PutBitContext *pb, int n, int32_t value)
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
This structure describes decoded (raw) audio or video data.
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
const uint8_t ff_reverse[256]
av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
const uint8_t ff_asv_scantab[64]
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
static av_cold int encode_init(AVCodecContext *avctx)
av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
int global_quality
Global quality for codecs which cannot change it per frame.
#define AV_CEIL_RSHIFT(a, b)
#define av_assert0(cond)
assert() equivalent, that is always enabled.
static enum AVPixelFormat pix_fmts[]
#define AV_INPUT_BUFFER_MIN_SIZE
static int encode_mb(ASV1Context *a, int16_t block[6][64])
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
const uint8_t ff_asv_ac_ccp_tab[16][2]
void ff_fdct_ifast(int16_t *data)
void avpriv_align_put_bits(PutBitContext *s)
Pad the bitstream with zeros up to the next byte boundary.
static void dct_get(ASV1Context *a, const AVFrame *frame, int mb_x, int mb_y)
#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.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
const uint16_t ff_mpeg1_default_intra_matrix[256]
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
int flags
A combination of AV_PKT_FLAG values.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define i(width, name, range_min, range_max)
static int put_bits_count(PutBitContext *s)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
const char * name
Name of the codec implementation.
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
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
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
main external API structure.
static void asv2_encode_block(ASV1Context *a, int16_t block[64])
const uint8_t ff_asv_ccp_tab[17][2]
static void asv2_put_level(ASV1Context *a, PutBitContext *pb, int level)
This structure stores compressed data.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
The exact code depends on how similar the blocks are and how related they are to the block
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
static void asv1_encode_block(ASV1Context *a, int16_t block[64])
const uint16_t ff_aanscales[64]