|
|
|
@ -305,7 +305,7 @@ static void encode_ac_coeffs(PutBitContext *pb, |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void get(uint8_t *pixels, int stride, int16_t* block) |
|
|
|
|
static void get(const uint8_t *pixels, int stride, int16_t* block) |
|
|
|
|
{ |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
@ -317,13 +317,13 @@ static void get(uint8_t *pixels, int stride, int16_t* block) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void fdct_get(FDCTDSPContext *fdsp, uint8_t *pixels, int stride, int16_t* block) |
|
|
|
|
static void fdct_get(FDCTDSPContext *fdsp, const uint8_t *pixels, int stride, int16_t* block) |
|
|
|
|
{ |
|
|
|
|
get(pixels, stride, block); |
|
|
|
|
fdsp->fdct(block); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void calc_plane_dct(FDCTDSPContext *fdsp, uint8_t *src, int16_t * blocks, int src_stride, int mb_count, int chroma, int is_422) |
|
|
|
|
static void calc_plane_dct(FDCTDSPContext *fdsp, const uint8_t *src, int16_t * blocks, int src_stride, int mb_count, int chroma, int is_422) |
|
|
|
|
{ |
|
|
|
|
int16_t *block; |
|
|
|
|
int i; |
|
|
|
@ -473,7 +473,7 @@ static av_always_inline int encode_alpha_slice_data(AVCodecContext *avctx, int8_ |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static inline void subimage_with_fill_template(uint16_t *src, unsigned x, unsigned y, |
|
|
|
|
static inline void subimage_with_fill_template(const uint16_t *src, unsigned x, unsigned y, |
|
|
|
|
unsigned stride, unsigned width, unsigned height, uint16_t *dst, |
|
|
|
|
unsigned dst_width, unsigned dst_height, int is_alpha_plane, |
|
|
|
|
int is_interlaced, int is_top_field) |
|
|
|
@ -521,7 +521,7 @@ static inline void subimage_with_fill_template(uint16_t *src, unsigned x, unsign |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void subimage_with_fill(uint16_t *src, unsigned x, unsigned y, |
|
|
|
|
static void subimage_with_fill(const uint16_t *src, unsigned x, unsigned y, |
|
|
|
|
unsigned stride, unsigned width, unsigned height, uint16_t *dst, |
|
|
|
|
unsigned dst_width, unsigned dst_height, int is_interlaced, int is_top_field) |
|
|
|
|
{ |
|
|
|
@ -529,7 +529,7 @@ static void subimage_with_fill(uint16_t *src, unsigned x, unsigned y, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* reorganize alpha data and convert 10b -> 16b */ |
|
|
|
|
static void subimage_alpha_with_fill(uint16_t *src, unsigned x, unsigned y, |
|
|
|
|
static void subimage_alpha_with_fill(const uint16_t *src, unsigned x, unsigned y, |
|
|
|
|
unsigned stride, unsigned width, unsigned height, uint16_t *dst, |
|
|
|
|
unsigned dst_width, unsigned dst_height, int is_interlaced, int is_top_field) |
|
|
|
|
{ |
|
|
|
@ -544,7 +544,7 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, int mb_x, |
|
|
|
|
ProresContext* ctx = avctx->priv_data; |
|
|
|
|
int hdr_size = 6 + (ctx->need_alpha * 2); /* v data size is write when there is alpha */ |
|
|
|
|
int ret = 0, slice_size; |
|
|
|
|
uint8_t *dest_y, *dest_u, *dest_v; |
|
|
|
|
const uint8_t *dest_y, *dest_u, *dest_v; |
|
|
|
|
unsigned y_data_size = 0, u_data_size = 0, v_data_size = 0, a_data_size = 0; |
|
|
|
|
FDCTDSPContext *fdsp = &ctx->fdsp; |
|
|
|
|
int tgt_bits = (mb_count * bitrate_table[avctx->profile]) >> 2; |
|
|
|
@ -577,13 +577,13 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, int mb_x, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (unsafe) { |
|
|
|
|
subimage_with_fill((uint16_t *) pic->data[0], mb_x << 4, mb_y << 4, |
|
|
|
|
subimage_with_fill((const uint16_t *) pic->data[0], mb_x << 4, mb_y << 4, |
|
|
|
|
luma_stride, avctx->width, avctx->height, |
|
|
|
|
(uint16_t *) ctx->fill_y, mb_count << 4, 16, is_interlaced, is_top_field); |
|
|
|
|
subimage_with_fill((uint16_t *) pic->data[1], mb_x << (4 - ctx->is_422), mb_y << 4, |
|
|
|
|
subimage_with_fill((const uint16_t *) pic->data[1], mb_x << (4 - ctx->is_422), mb_y << 4, |
|
|
|
|
chroma_stride, avctx->width >> ctx->is_422, avctx->height, |
|
|
|
|
(uint16_t *) ctx->fill_u, mb_count << (4 - ctx->is_422), 16, is_interlaced, is_top_field); |
|
|
|
|
subimage_with_fill((uint16_t *) pic->data[2], mb_x << (4 - ctx->is_422), mb_y << 4, |
|
|
|
|
subimage_with_fill((const uint16_t *) pic->data[2], mb_x << (4 - ctx->is_422), mb_y << 4, |
|
|
|
|
chroma_stride, avctx->width >> ctx->is_422, avctx->height, |
|
|
|
|
(uint16_t *) ctx->fill_v, mb_count << (4 - ctx->is_422), 16, is_interlaced, is_top_field); |
|
|
|
|
|
|
|
|
@ -640,7 +640,7 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic, int mb_x, |
|
|
|
|
if (ctx->need_alpha) { |
|
|
|
|
AV_WB16(buf + 6, v_data_size); /* write v data size only if there is alpha */ |
|
|
|
|
|
|
|
|
|
subimage_alpha_with_fill((uint16_t *) pic->data[3], mb_x << 4, mb_y << 4, |
|
|
|
|
subimage_alpha_with_fill((const uint16_t *) pic->data[3], mb_x << 4, mb_y << 4, |
|
|
|
|
alpha_stride, avctx->width, avctx->height, |
|
|
|
|
(uint16_t *) ctx->fill_a, mb_count << 4, 16, is_interlaced, is_top_field); |
|
|
|
|
ret = encode_alpha_slice_data(avctx, ctx->fill_a, mb_count, |
|
|
|
|