51 int plane,
int x,
int y,
int ilace,
52 int16_t *block0, int16_t *
block1)
57 pic->
linesize[plane] << ilace, block0);
59 pic->
linesize[plane] << ilace, block1);
63 int qsel,
int is_chroma,
int is_hqa)
68 memset(block, 0, 64 *
sizeof(*block));
102 for (i = 0; i < 8; i++) {
117 int prof_num,
size_t data_size)
122 uint32_t slice_off[21];
123 int slice, start_off, next_off, i, ret;
146 slice_off[i] = bytestream2_get_be24(&ctx->
gbc) - 4;
149 for (slice = 0; slice < profile->
num_slices; slice++) {
150 start_off = next_off;
155 slice_off[slice] >= slice_off[slice + 1] ||
156 slice_off[slice + 1] > data_size) {
162 (slice_off[slice + 1] - slice_off[slice]) * 8);
164 for (i = 0; i < (next_off - start_off) * profile->
tab_w; i++) {
165 ret =
hq_decode_mb(ctx, pic, &gb, perm[0] * 16, perm[1] * 16);
168 "Error decoding macroblock %d at slice %d.\n", i, slice);
186 for (i = 0; i < 12; i++)
188 for (i = 0; i < 12; i++)
189 c->
block[i][0] = -128 * (1 << 6);
199 for (i = 0; i < 12; i++) {
200 if (!(cbp & (1 << i)))
219 int quant,
int slice_no,
int w,
int h)
224 for (i = 0; i <
h; i += 16) {
225 off = (slice_no * 16 + i * 3) & 0x70;
226 for (j = off; j < w; j += 128) {
230 "Error decoding macroblock at %dx%d.\n", i, j);
242 const int num_slices = 8;
243 uint32_t slice_off[9];
248 width = bytestream2_get_be16(&ctx->
gbc);
249 height = bytestream2_get_be16(&ctx->
gbc);
260 quant = bytestream2_get_byte(&ctx->
gbc);
264 "Invalid quantization matrix %d.\n", quant);
273 for (i = 0; i < num_slices + 1; i++)
274 slice_off[i] = bytestream2_get_be32(&ctx->
gbc) - 4;
276 for (slice = 0; slice < num_slices; slice++) {
277 if (slice_off[slice] < (num_slices + 1) * 3 ||
278 slice_off[slice] >= slice_off[slice + 1] ||
279 slice_off[slice + 1] > data_size) {
285 (slice_off[slice + 1] - slice_off[slice]) * 8);
301 unsigned int data_size;
311 info_tag = bytestream2_peek_le32(&ctx->
gbc);
312 if (info_tag ==
MKTAG(
'I',
'N',
'F',
'O')) {
315 info_size = bytestream2_get_le32(&ctx->
gbc);
334 tag = bytestream2_get_le32(&ctx->
gbc);
335 if ((tag & 0x00FFFFFF) == (
MKTAG(
'U',
'V',
'C',
' ') & 0x00FFFFFF)) {
337 }
else if (tag ==
MKTAG(
'H',
'Q',
'A',
'1')) {
#define FF_CODEC_CAP_INIT_CLEANUP
The codec allows calling the close function for deallocation even if the init function returned a fai...
const char const char void * val
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
This structure describes decoded (raw) audio or video data.
ptrdiff_t const GLvoid * data
int coded_width
Bitstream width / height, may be different from width/height e.g.
static int hq_decode_frame(HQContext *ctx, AVFrame *pic, int prof_num, size_t data_size)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
static av_cold int init(AVCodecContext *avctx)
int ff_canopus_parse_info_tag(AVCodecContext *avctx, const uint8_t *src, size_t size)
void(* idct_put)(uint8_t *dst, int stride, int16_t *block)
static int hq_hqa_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
static av_cold int hq_hqa_decode_init(AVCodecContext *avctx)
static int hq_decode_mb(HQContext *c, AVFrame *pic, GetBitContext *gb, int x, int y)
const int32_t *const ff_hq_quants[16][2][4]
int bits_per_raw_sample
Bits per sample/pixel of internal libavcodec pixel/sample format.
AVCodec ff_hq_hqa_decoder
static int get_sbits(GetBitContext *s, int n)
static void decode(AVCodecContext *dec_ctx, AVPacket *pkt, AVFrame *frame, FILE *outfile)
const HQProfile ff_hq_profile[NUM_HQ_PROFILES]
Macro definitions for various function/variable attributes.
HQ/HQA variant of AAN IDCT It differs from the standard AAN IDCT in precision and in the second stage...
void void avpriv_request_sample(void *avc, const char *msg,...) av_printf_format(2
Log a generic warning message about a missing feature.
#define FF_CODEC_CAP_INIT_THREADSAFE
The codec does not modify any global variables in the init function, allowing to call the init functi...
static int hqa_decode_slice(HQContext *ctx, AVFrame *pic, GetBitContext *gb, int quant, int slice_no, int w, int h)
bitstream reader API header.
#define AV_LOG_VERBOSE
Detailed information.
planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static av_always_inline void bytestream2_skip(GetByteContext *g, unsigned int size)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static av_always_inline unsigned int bytestream2_get_bytes_left(GetByteContext *g)
const char * name
Name of the codec implementation.
int ff_hq_init_vlcs(HQContext *c)
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
static int hqa_decode_mb(HQContext *c, AVFrame *pic, int qgroup, GetBitContext *gb, int x, int y)
enum AVPictureType pict_type
Picture type of the frame.
int width
picture width / height.
static int hqa_decode_frame(HQContext *ctx, AVFrame *pic, size_t data_size)
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
Libavcodec external API header.
int linesize[AV_NUM_DATA_POINTERS]
For video, size in bytes of each picture line.
main external API structure.
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
static unsigned int get_bits1(GetBitContext *s)
const int16_t ff_hq_ac_syms[NUM_HQ_AC_ENTRIES]
static int init_get_bits(GetBitContext *s, const uint8_t *buffer, int bit_size)
Initialize GetBitContext.
const uint8_t ff_zigzag_direct[64]
static void put_blocks(HQContext *c, AVFrame *pic, int plane, int x, int y, int ilace, int16_t *block0, int16_t *block1)
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
common internal api header.
static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64], int qsel, int is_chroma, int is_hqa)
static av_cold int hq_hqa_decode_close(AVCodecContext *avctx)
VLC_TYPE(* table)[2]
code, bits
int key_frame
1 -> keyframe, 0-> not
static int16_t block1[64]
av_cold void ff_hqdsp_init(HQDSPContext *c)
#define MKTAG(a, b, c, d)
This structure stores compressed data.
void ff_free_vlc(VLC *vlc)
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
const uint8_t ff_hq_ac_skips[NUM_HQ_AC_ENTRIES]