#include "thread.h"
typedef struct RowContext {
- DECLARE_ALIGNED(16, int16_t, blocks)[12][64];
+ DECLARE_ALIGNED(32, int16_t, blocks)[12][64];
int luma_scale[64];
int chroma_scale[64];
GetBitContext gb;
const CIDEntry *cid_table;
int bit_depth; // 8, 10, 12 or 0 if not initialized at all.
int is_444;
+ int alpha;
+ int lla;
int mbaff;
int act;
int (*decode_dct_block)(const struct DNXHDContext *ctx,
ctx->cur_field = 0;
}
ctx->mbaff = (buf[0x6] >> 5) & 1;
+ ctx->alpha = buf[0x7] & 1;
+ ctx->lla = (buf[0x7] >> 1) & 1;
+ if (ctx->alpha)
+ avpriv_request_sample(ctx->avctx, "alpha");
ctx->height = AV_RB16(buf + 0x18);
ctx->width = AV_RB16(buf + 0x1a);
const DNXHDContext *ctx = avctx->priv_data;
uint32_t offset = ctx->mb_scan_index[rownb];
RowContext *row = ctx->rows + threadnb;
- int x;
+ int x, ret;
row->last_dc[0] =
row->last_dc[1] =
row->last_dc[2] = 1 << (ctx->bit_depth + 2); // for levels +2^(bitdepth-1)
- init_get_bits(&row->gb, ctx->buf + offset, (ctx->buf_size - offset) << 3);
+ ret = init_get_bits8(&row->gb, ctx->buf + offset, ctx->buf_size - offset);
+ if (ret < 0) {
+ row->errors++;
+ return ret;
+ }
for (x = 0; x < ctx->mb_width; x++) {
//START_TIMER;
int ret = dnxhd_decode_macroblock(ctx, row, data, x, rownb);