|
|
@ -33,6 +33,23 @@ int dct_quantize_c(MpegEncContext *s, DCTELEM *block, int n, int qscale, int *ov |
|
|
|
|
|
|
|
|
|
|
|
#define LAMBDA_FRAC_BITS 10 |
|
|
|
#define LAMBDA_FRAC_BITS 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static av_always_inline void dnxhd_get_pixels_8x4(DCTELEM *restrict block, const uint8_t *pixels, int line_size) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int i; |
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) { |
|
|
|
|
|
|
|
block[0] = pixels[0]; block[1] = pixels[1]; |
|
|
|
|
|
|
|
block[2] = pixels[2]; block[3] = pixels[3]; |
|
|
|
|
|
|
|
block[4] = pixels[4]; block[5] = pixels[5]; |
|
|
|
|
|
|
|
block[6] = pixels[6]; block[7] = pixels[7]; |
|
|
|
|
|
|
|
pixels += line_size; |
|
|
|
|
|
|
|
block += 8; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
memcpy(block , block- 8, sizeof(*block)*8); |
|
|
|
|
|
|
|
memcpy(block+ 8, block-16, sizeof(*block)*8); |
|
|
|
|
|
|
|
memcpy(block+16, block-24, sizeof(*block)*8); |
|
|
|
|
|
|
|
memcpy(block+24, block-32, sizeof(*block)*8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static int dnxhd_init_vlc(DNXHDEncContext *ctx) |
|
|
|
static int dnxhd_init_vlc(DNXHDEncContext *ctx) |
|
|
|
{ |
|
|
|
{ |
|
|
|
int i, j, level, run; |
|
|
|
int i, j, level, run; |
|
|
@ -330,23 +347,6 @@ static av_always_inline int dnxhd_calc_ac_bits(DNXHDEncContext *ctx, DCTELEM *bl |
|
|
|
return bits; |
|
|
|
return bits; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static av_always_inline void dnxhd_get_pixels_8x4(DCTELEM *restrict block, const uint8_t *pixels, int line_size) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
int i; |
|
|
|
|
|
|
|
for (i = 0; i < 4; i++) { |
|
|
|
|
|
|
|
block[0] = pixels[0]; block[1] = pixels[1]; |
|
|
|
|
|
|
|
block[2] = pixels[2]; block[3] = pixels[3]; |
|
|
|
|
|
|
|
block[4] = pixels[4]; block[5] = pixels[5]; |
|
|
|
|
|
|
|
block[6] = pixels[6]; block[7] = pixels[7]; |
|
|
|
|
|
|
|
pixels += line_size; |
|
|
|
|
|
|
|
block += 8; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
memcpy(block , block- 8, sizeof(*block)*8); |
|
|
|
|
|
|
|
memcpy(block+ 8, block-16, sizeof(*block)*8); |
|
|
|
|
|
|
|
memcpy(block+16, block-24, sizeof(*block)*8); |
|
|
|
|
|
|
|
memcpy(block+24, block-32, sizeof(*block)*8); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y) |
|
|
|
static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, int mb_y) |
|
|
|
{ |
|
|
|
{ |
|
|
|
const uint8_t *ptr_y = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize) + (mb_x << 4); |
|
|
|
const uint8_t *ptr_y = ctx->thread[0]->src[0] + ((mb_y << 4) * ctx->m.linesize) + (mb_x << 4); |
|
|
|