26 #include "libavutil/attributes.h"
27 #include "libavutil/mem.h"
40 unsigned int index= level + 3;
50 unsigned int index= level + 31;
70 if( (block[index + 0] = (block[index + 0]*a->
q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
71 if( (block[index + 8] = (block[index + 8]*a->
q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
72 if( (block[index + 1] = (block[index + 1]*a->
q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
73 if( (block[index + 9] = (block[index + 9]*a->
q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
76 for(;nc_count; nc_count--)
96 for(count=63; count>3; count--){
109 for(i=0; i<=count; i++){
113 if( (block[index + 0] = (block[index + 0]*a->
q_intra_matrix[index + 0] + (1<<15))>>16) ) ccp |= 8;
114 if( (block[index + 8] = (block[index + 8]*a->
q_intra_matrix[index + 8] + (1<<15))>>16) ) ccp |= 4;
115 if( (block[index + 1] = (block[index + 1]*a->
q_intra_matrix[index + 1] + (1<<15))>>16) ) ccp |= 2;
116 if( (block[index + 9] = (block[index + 9]*a->
q_intra_matrix[index + 9] + (1<<15))>>16) ) ccp |= 1;
131 #define MAX_MB_SIZE (30*16*16*3/2/8)
158 uint8_t *ptr_y = frame->
data[0] + (mb_y * 16* linesize ) + mb_x * 16;
178 const AVFrame *pict,
int *got_packet)
210 for(mb_x=0; mb_x<a->
mb_width; mb_x++){
225 (uint32_t *) pkt->
data, size);
228 for(i=0; i<4*
size; i++)
277 #if CONFIG_ASV1_ENCODER
292 #if CONFIG_ASV2_ENCODER
static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVFrame *pict, int *got_packet)
This structure describes decoded (raw) audio or video data.
const uint8_t ff_asv_ac_ccp_tab[16][2]
static void put_sbits(PutBitContext *pb, int n, int32_t value)
void avpriv_align_put_bits(PutBitContext *s)
Pad the bitstream with zeros up to the next byte boundary.
void av_log(void *avcl, int level, const char *fmt,...) av_printf_format(3
Send the specified message to the log if the level is less than or equal to the current av_log_level...
av_cold void ff_fdctdsp_init(FDCTDSPContext *c, AVCodecContext *avctx)
uint8_t * extradata
some codecs need / can use extradata like Huffman tables.
AVFrame * av_frame_alloc(void)
Allocate an AVFrame and set its fields to default values.
const uint8_t ff_asv2_level_tab[63][2]
void(* bswap_buf)(uint32_t *dst, const uint32_t *src, int w)
const char * name
Name of the codec implementation.
const uint8_t ff_asv_ccp_tab[17][2]
const uint8_t ff_asv_dc_ccp_tab[8][2]
static void asv2_put_level(PutBitContext *pb, int level)
#define AV_PKT_FLAG_KEY
The packet contains a keyframe.
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
const uint16_t ff_mpeg1_default_intra_matrix[64]
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
void(* get_pixels)(int16_t *block, const uint8_t *pixels, int line_size)
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
av_cold void ff_asv_common_init(AVCodecContext *avctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int encode_mb(ASV1Context *a, int16_t block[6][64])
static void put_bits(PutBitContext *s, int n, unsigned int value)
Write up to 31 bits into a bitstream.
ASUS V1/V2 encoder/decoder common data.
Libavcodec external API header.
AVPixelFormat
Pixel format.
int flags
A combination of AV_PKT_FLAG values.
static int put_bits_count(PutBitContext *s)
enum AVPictureType pict_type
Picture type of the frame.
#define FF_MIN_BUFFER_SIZE
minimum encoding buffer size Used to avoid some checks during header writing.
static av_cold int encode_init(AVCodecContext *avctx)
void(* fdct)(int16_t *block)
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
static void asv1_encode_block(ASV1Context *a, int16_t block[64])
main external API structure.
static void close(AVCodecParserContext *s)
static void asv1_put_level(PutBitContext *pb, int level)
static void dct_get(ASV1Context *a, const AVFrame *frame, int mb_x, int mb_y)
AVFrame * coded_frame
the picture in the bitstream
av_cold void ff_pixblockdsp_init(PixblockDSPContext *c, AVCodecContext *avctx)
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
int global_quality
Global quality for codecs which cannot change it per frame.
#define CODEC_FLAG_GRAY
Only decode/encode grayscale.
static void asv2_encode_block(ASV1Context *a, int16_t block[64])
static void init_put_bits(PutBitContext *s, uint8_t *buffer, int buffer_size)
Initialize the PutBitContext s.
static av_cold int init(AVCodecParserContext *s)
int key_frame
1 -> keyframe, 0-> not
static void asv2_put_bits(PutBitContext *pb, int n, int v)
static av_cold int asv_encode_close(AVCodecContext *avctx)
const uint8_t ff_reverse[256]
const uint8_t ff_asv_scantab[64]
const uint8_t ff_asv_level_tab[7][2]
This structure stores compressed data.
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
void * av_mallocz(size_t size) av_malloc_attrib 1(1)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...