diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-12-02 22:27:19 +0300 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2007-12-02 22:27:19 +0300 |
commit | cc3a9708571fcc8315e35f07ba47fa831919887b (patch) | |
tree | a1a0a549bc89b5a94c8adf2eed175cf2e28d8854 /libavcodec/dnxhdenc.c | |
parent | df745b9ce688cfdf9c852ab31304462380435ced (diff) |
dnxhd 720p encoding and decoding support
Originally committed as revision 11133 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r-- | libavcodec/dnxhdenc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 8d5bbadad3..fc4a559c2a 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -171,6 +171,7 @@ static int dnxhd_encode_init(AVCodecContext *avctx) DNXHDEncContext *ctx = avctx->priv_data; int i, index; + if (avctx->width == 1920 && avctx->height == 1080) { if (avctx->flags & CODEC_FLAG_INTERLACED_DCT) { if (avctx->bit_rate == 120000000) ctx->cid = 1242; @@ -184,7 +185,14 @@ static int dnxhd_encode_init(AVCodecContext *avctx) else if (avctx->bit_rate == 36000000) ctx->cid = 1253; } - if (!ctx->cid || avctx->width != 1920 || avctx->height != 1080 || avctx->pix_fmt != PIX_FMT_YUV422P) { + } else if (avctx->width == 1280 && avctx->height == 720 && + !(avctx->flags & CODEC_FLAG_INTERLACED_DCT)) { + if (avctx->bit_rate == 90000000) + ctx->cid = 1251; + else if (avctx->bit_rate == 60000000) + ctx->cid = 1252; + } + if (!ctx->cid || avctx->pix_fmt != PIX_FMT_YUV422P) { av_log(avctx, AV_LOG_ERROR, "video parameters incompatible with DNxHD\n"); return -1; } @@ -421,7 +429,7 @@ static av_always_inline void dnxhd_get_blocks(DNXHDEncContext *ctx, int mb_x, in dsp->get_pixels(ctx->blocks[2], ptr_u , ctx->m.uvlinesize); dsp->get_pixels(ctx->blocks[3], ptr_v , ctx->m.uvlinesize); - if (mb_y+1 == ctx->m.mb_height) { + if (mb_y+1 == ctx->m.mb_height && ctx->m.avctx->height == 1080) { if (ctx->interlaced) { dnxhd_get_pixels_4x8(ctx->blocks[4], ptr_y + ctx->dct_y_offset , ctx->m.linesize); dnxhd_get_pixels_4x8(ctx->blocks[5], ptr_y + ctx->dct_y_offset + 8, ctx->m.linesize); |