57 if (level < -128 || level > 127) {
73 for (
i = 0;
i < 10;
i++) {
78 a->q_intra_matrix[
index + 0] + (1 << 15)) >> 16))
81 a->q_intra_matrix[
index + 8] + (1 << 15)) >> 16))
84 a->q_intra_matrix[
index + 1] + (1 << 15)) >> 16))
87 a->q_intra_matrix[
index + 9] + (1 << 15)) >> 16))
91 for (; nc_count; nc_count--)
116 for (count = 63; count > 3; count--) {
128 for (
i = 0;
i <= count;
i++) {
133 a->q_intra_matrix[
index + 0] + (1 << 15)) >> 16))
136 a->q_intra_matrix[
index + 8] + (1 << 15)) >> 16))
139 a->q_intra_matrix[
index + 1] + (1 << 15)) >> 16))
142 a->q_intra_matrix[
index + 9] + (1 << 15)) >> 16))
164 #define MAX_MB_SIZE (30 * 16 * 16 * 3 / 2 / 8)
173 for (
i = 0;
i < 6;
i++)
176 for (
i = 0;
i < 6;
i++) {
186 int16_t (*
block)[64] =
a->block;
194 a->pdsp.get_pixels(
block[0], ptr_y, linesize);
195 a->pdsp.get_pixels(
block[1], ptr_y + 8, linesize);
196 a->pdsp.get_pixels(
block[2], ptr_y + 8 * linesize, linesize);
197 a->pdsp.get_pixels(
block[3], ptr_y + 8 * linesize + 8, linesize);
198 for (
i = 0;
i < 4;
i++)
204 for (
i = 4;
i < 6;
i++)
210 const AVFrame *pict,
int *got_packet)
237 for (
i = 0;
i<3;
i++) {
264 for (mb_y = 0; mb_y <
a->mb_height2; mb_y++) {
265 for (mb_x = 0; mb_x <
a->mb_width2; mb_x++) {
271 if (
a->mb_width2 !=
a->mb_width) {
273 for (mb_y = 0; mb_y <
a->mb_height2; mb_y++) {
279 if (
a->mb_height2 !=
a->mb_height) {
280 mb_y =
a->mb_height2;
281 for (mb_x = 0; mb_x <
a->mb_width; mb_x++) {
296 a->bbdsp.bswap_buf((uint32_t *)
pkt->
data,
330 for (
i = 0;
i < 64;
i++) {
333 a->q_intra_matrix[
i] = (((int64_t)
a->inv_qscale << 30) + q / 2) / q;
336 a->q_intra_matrix[
i] = ((
a->inv_qscale << 16) + q / 2) / q;
343 #if CONFIG_ASV1_ENCODER
358 #if CONFIG_ASV2_ENCODER
const uint16_t ff_aanscales[64]
AAN (Arai, Agui and Nakajima) (I)DCT tables.
const uint8_t ff_asv_level_tab[7][2]
const uint8_t ff_asv_dc_ccp_tab[8][2]
const uint8_t ff_asv_scantab[64]
const uint8_t ff_asv_ac_ccp_tab[16][2]
const uint16_t ff_asv2_level_tab[63][2]
av_cold void ff_asv_common_init(AVCodecContext *avctx)
const uint8_t ff_asv_ccp_tab[17][2]
ASUS V1/V2 encoder/decoder common data.
static void asv1_put_level(PutBitContext *pb, int level)
static int encode_mb(ASV1Context *a, int16_t block[6][64])
static void dct_get(ASV1Context *a, const AVFrame *frame, int mb_x, int mb_y)
static void asv1_encode_block(ASV1Context *a, int16_t block[64])
static void asv2_encode_block(ASV1Context *a, int16_t block[64])
static av_cold int encode_init(AVCodecContext *avctx)
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
static void asv2_put_level(ASV1Context *a, PutBitContext *pb, int level)
Macro definitions for various function/variable attributes.
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
#define av_assert0(cond)
assert() equivalent, that is always enabled.
Libavcodec external API header.
static av_cold int init(AVCodecContext *avctx)
#define AV_CEIL_RSHIFT(a, b)
void ff_fdct_ifast(int16_t *data)
int ff_alloc_packet2(AVCodecContext *avctx, AVPacket *avpkt, int64_t size, int64_t min_size)
Check AVPacket size and/or allocate data.
av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
#define AV_CODEC_FLAG_GRAY
Only decode/encode grayscale.
#define AV_INPUT_BUFFER_MIN_SIZE
minimum encoding buffer size Used to avoid some checks during header writing.
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_frame_get_buffer(AVFrame *frame, int align)
Allocate new buffer(s) for audio or video data.
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
int av_frame_copy(AVFrame *dst, const AVFrame *src)
Copy the frame data from src to dst.
#define AV_LOG_WARNING
Something somehow does not look correct.
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
static void put_bits(Jpeg2000EncoderContext *s, int val, int n)
put n times val bit
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
static enum AVPixelFormat pix_fmts[]
Memory handling functions.
const uint16_t ff_mpeg1_default_intra_matrix[256]
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
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.
static void put_bits_le(PutBitContext *s, int n, BitBuf value)
static void flush_put_bits_le(PutBitContext *s)
static uint8_t * put_bits_ptr(PutBitContext *s)
Return the pointer to the byte where the bitstream writer will put the next bit.
static int put_bits_count(PutBitContext *s)
static void flush_put_bits(PutBitContext *s)
Pad the end of the output stream with zeros.
main external API structure.
int global_quality
Global quality for codecs which cannot change it per frame.
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
const char * name
Name of the codec implementation.
This structure describes decoded (raw) audio or video data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
int format
format of the frame, -1 if unknown or unset Values correspond to enum AVPixelFormat for video frames,...
This structure stores compressed data.
int flags
A combination of AV_PKT_FLAG values.