32#define CACHED_BITSTREAM_READER !ARCH_X86_32
59 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
60 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
61 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
62 1, 1, 1, 1, 1, 1,64,63,62,61,
63 60,59,58,57,56,55,54,53,52,51,
64 50,49,48,47,46,45,44,43,42,41,
65 40,39,38,37,36,35,34,33,32,31,
66 30,29,28,27,26,25,24,23,22,21,
67 20,19,18,17,16,15,14,13,12,11,
68 10, 9, 8, 7, 6, 5, 4, 3, 2, 1,
71static const uint8_t
quant[64] = {
72 16, 16, 19, 22, 22, 26, 26, 27,
73 16, 16, 22, 22, 26, 27, 27, 29,
74 19, 22, 26, 26, 27, 29, 29, 35,
75 22, 24, 27, 27, 29, 32, 34, 38,
76 26, 27, 29, 29, 32, 35, 38, 46,
77 27, 29, 34, 34, 35, 40, 46, 56,
78 29, 34, 34, 37, 40, 48, 56, 69,
79 34, 37, 38, 40, 48, 58, 69, 83,
94 s->idsp.idct_permutation);
101 int sign = (buf & 1) - 1;
102 return ((buf >> 1) ^ (~sign));
107 unsigned *dcrun,
unsigned *acrun,
110 const ptrdiff_t linesize =
frame->linesize[plane];
111 uint8_t *
dst =
frame->data[plane] + by * linesize;
112 unsigned dc_run = *dcrun, ac_run = *acrun;
115 const int16_t *factors =
s->factors;
116 const uint8_t *scan =
s->scan;
117 const int add = plane ? 0 : 1024;
118 int i, dc_v = 0, ac_v = 0, dc = 0;
119 const int lshift =
s->lshift;
121 for (
int y = 0; y < 2; y++) {
122 for (
int x = 0; x <
width; x += 8) {
131 dc += (unsigned)dc_v;
136 for (
int n = 0; n < 64; n++) {
146 block[
i] = ((unsigned)ac_v * factors[
i]) >> 4;
151 block[0] = ((unsigned)dc << lshift) + (
unsigned)add;
152 s->idsp.idct_put(
dst + x, linesize,
block);
165 const uint8_t *dc_src,
unsigned dc_slice_size,
166 const uint8_t *ac_src,
unsigned ac_slice_size,
169 unsigned dc_run = 0, ac_run = 0;
181 for (
int p = 0; p < 3; p++) {
182 const int rshift = !!p;
184 &dc_run, &ac_run,
frame,
185 frame->width >> rshift, by, p);
207 int n,
int thread_nb)
210 const uint8_t *dc_slice_ptr =
s->slices[n].dc_ptr;
211 const uint8_t *ac_slice_ptr =
s->slices[n].ac_ptr;
212 unsigned dc_slice_size =
s->slices[n].dc_size;
213 unsigned ac_slice_size =
s->slices[n].ac_size;
217 ac_slice_ptr, ac_slice_size, n * 16);
228 if (avpkt->
size <= 7)
234 s->lshift = avpkt->
data[1];
242 for (
int n = 0; n < 64; n++)
243 s->factors[n] =
quant[n] * q;
245 s->nb_slices = (avctx->
height + 15) / 16;
250 for (
int n = 0; n <
s->nb_slices; n++) {
257 if (slice_size > avpkt->
size)
263 s->slices[n].dc_size = slice_size;
268 for (
int n = 0; n <
s->nb_slices; n++) {
275 if (slice_size > avpkt->
size)
281 s->slices[n].ac_size = slice_size;
uint8_t ptrdiff_t const uint8_t ptrdiff_t int intptr_t intptr_t int int16_t * dst
const FFCodec ff_vmix_decoder
static av_cold void close(AVCodecParserContext *s)
Libavcodec external API header.
#define i(width, name, range_min, range_max)
#define FF_CODEC_DECODE_CB(func)
#define CODEC_LONG_NAME(str)
int(* init)(AVBSFContext *ctx)
static int decode_slices(AVCodecContext *avctx, RangeCoder c, AVPacket *avpkt)
bitstream reader API header.
static int get_bits_left(GetBitContext *gb)
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static const uint8_t * align_get_bits(GetBitContext *s)
static unsigned get_ue_golomb_long(GetBitContext *gb)
Read an unsigned Exp-Golomb code in the range 0 to UINT32_MAX-1.
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
#define AV_CODEC_CAP_SLICE_THREADS
Codec supports slice-based (or partition-based) multithreading.
#define AV_CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
void av_fast_mallocz(void *ptr, unsigned int *size, size_t min_size)
Allocate and clear a buffer, reusing the given one if large enough.
static av_cold int decode_init(AVCodecContext *avctx)
static av_cold int decode_end(AVCodecContext *avctx)
static int decode_frame(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
av_cold void ff_idctdsp_init(IDCTDSPContext *c, AVCodecContext *avctx)
av_cold void ff_permute_scantable(uint8_t dst[64], const uint8_t src[64], const uint8_t permutation[64])
Multithreading API for decoders.
const uint8_t ff_zigzag_direct[64]
Memory handling functions.
#define LOCAL_ALIGNED_32(t, v,...)
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
int ff_thread_get_buffer(AVCodecContext *avctx, AVFrame *f, int flags)
Wrapper around get_buffer() for frame-multithreaded codecs.
#define FF_ARRAY_ELEMS(a)
main external API structure.
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
int width
picture width / height.
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
int(* execute2)(struct AVCodecContext *c, int(*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count)
The codec may call this to execute several independent things.
int coded_width
Bitstream width / height, may be different from width/height e.g.
This structure describes decoded (raw) audio or video data.
This structure stores compressed data.
static int decode_frame(AVCodecContext *avctx, AVFrame *frame, int *got_frame, AVPacket *avpkt)
static int decode_slices(AVCodecContext *avctx, void *arg, int n, int thread_nb)
static av_cold int decode_init(AVCodecContext *avctx)
static int decode_dcac(AVCodecContext *avctx, GetBitContext *dc_gb, GetBitContext *ac_gb, unsigned *dcrun, unsigned *acrun, AVFrame *frame, int width, int by, int plane)
static av_cold int decode_end(AVCodecContext *avctx)
static const uint8_t quant[64]
static const uint8_t quality[]
static int get_se_golomb_vmix(GetBitContext *gb)
static int decode_slice(AVCodecContext *avctx, AVFrame *frame, const uint8_t *dc_src, unsigned dc_slice_size, const uint8_t *ac_src, unsigned ac_slice_size, int by)