Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From f24a5dc804fa7250a362c8f72498ccda691e93bd Mon Sep 17 00:00:00 2001
- From: Kieran Kunhya <kieran@kunhya.com>
- Date: Fri, 28 Sep 2018 21:45:24 +0100
- Subject: [PATCH] Base of prores 12-bit
- ---
- libavcodec/proresdec2.c | 4 ++--
- libavcodec/proresdsp.c | 4 +++-
- libavcodec/proresdsp.h | 2 +-
- libavcodec/simple_idct.c | 8 ++++----
- 4 files changed, 10 insertions(+), 8 deletions(-)
- diff --git a/libavcodec/proresdec2.c b/libavcodec/proresdec2.c
- index d818e5d8da..fca7f58926 100644
- --- a/libavcodec/proresdec2.c
- +++ b/libavcodec/proresdec2.c
- @@ -115,7 +115,7 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf,
- if (ctx->alpha_info) {
- avctx->pix_fmt = (buf[12] & 0xC0) == 0xC0 ? AV_PIX_FMT_YUVA444P10 : AV_PIX_FMT_YUVA422P10;
- } else {
- - avctx->pix_fmt = (buf[12] & 0xC0) == 0xC0 ? AV_PIX_FMT_YUV444P10 : AV_PIX_FMT_YUV422P10;
- + avctx->pix_fmt = (buf[12] & 0xC0) == 0xC0 ? AV_PIX_FMT_YUV444P12 : AV_PIX_FMT_YUV422P12;
- }
- avctx->color_primaries = buf[14];
- @@ -564,7 +564,7 @@ static int decode_slice_thread(AVCodecContext *avctx, void *arg, int jobnr, int
- chroma_stride = pic->linesize[1] << 1;
- }
- - if (avctx->pix_fmt == AV_PIX_FMT_YUV444P10 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) {
- + if (avctx->pix_fmt == AV_PIX_FMT_YUV444P12 || avctx->pix_fmt == AV_PIX_FMT_YUVA444P10) {
- mb_x_shift = 5;
- log2_chroma_blocks_per_mb = 2;
- } else {
- diff --git a/libavcodec/proresdsp.c b/libavcodec/proresdsp.c
- index 5b5ada21fe..8e1357ad52 100644
- --- a/libavcodec/proresdsp.c
- +++ b/libavcodec/proresdsp.c
- @@ -28,7 +28,7 @@
- #include "simple_idct.h"
- #define BIAS (1 << (PRORES_BITS_PER_SAMPLE - 1)) ///< bias value for converting signed pixels into unsigned ones
- -#define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 8)) ///< minimum value for clipping resulting pixels
- +#define CLIP_MIN (1 << (PRORES_BITS_PER_SAMPLE - 10)) ///< minimum value for clipping resulting pixels
- #define CLIP_MAX (1 << PRORES_BITS_PER_SAMPLE) - CLIP_MIN - 1 ///< maximum value for clipping resulting pixels
- #define CLIP(x) (av_clip((x), CLIP_MIN, CLIP_MAX))
- @@ -60,8 +60,10 @@ av_cold void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
- dsp->idct_put = prores_idct_put_c;
- dsp->idct_permutation_type = FF_IDCT_PERM_NONE;
- +#if 0
- if (ARCH_X86)
- ff_proresdsp_init_x86(dsp, avctx);
- +#endif
- ff_init_scantable_permutation(dsp->idct_permutation,
- dsp->idct_permutation_type);
- diff --git a/libavcodec/proresdsp.h b/libavcodec/proresdsp.h
- index 558fae53bf..6a84476a7f 100644
- --- a/libavcodec/proresdsp.h
- +++ b/libavcodec/proresdsp.h
- @@ -27,7 +27,7 @@
- #include <stdint.h>
- #include "avcodec.h"
- -#define PRORES_BITS_PER_SAMPLE 10 ///< output precision of prores decoder
- +#define PRORES_BITS_PER_SAMPLE 12 ///< output precision of prores decoder
- typedef struct ProresDSPContext {
- int idct_permutation_type;
- diff --git a/libavcodec/simple_idct.c b/libavcodec/simple_idct.c
- index 78b29c0fe3..a9de58c90f 100644
- --- a/libavcodec/simple_idct.c
- +++ b/libavcodec/simple_idct.c
- @@ -241,13 +241,13 @@ void ff_prores_idct(int16_t *block, const int16_t *qmat)
- int i;
- for (i = 0; i < 64; i++)
- - block[i] *= qmat[i];
- + block[i] *= qmat[i]; // FIXME do this in the codec
- for (i = 0; i < 8; i++)
- - idctRowCondDC_extrashift_10(block + i*8, 2);
- + idctRowCondDC_int16_12bit(block + i*8, 0);
- for (i = 0; i < 8; i++) {
- - block[i] += 8192;
- - idctSparseCol_extrashift_10(block + i);
- + block[i] += 8192; // FIXME: do this in the codec
- + idctSparseCol_int16_12bit(block + i);
- }
- }
- --
- 2.11.0.windows.1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement