summaryrefslogtreecommitdiffstats
path: root/libavcodec/dnxhdenc.c
diff options
context:
space:
mode:
authorBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-12-18 13:52:07 +0000
committerBaptiste Coudurier <baptiste.coudurier@gmail.com>2007-12-18 13:52:07 +0000
commit0c39c38b1456d4a59c4982db74facaa1722edc18 (patch)
tree2a8c45b49bc75b25a1971bf01772e6e0b9a5d850 /libavcodec/dnxhdenc.c
parent86404ffba2d8795d44cffbbeee3b3c7c2cc6afcc (diff)
downloadffmpeg-streaming-0c39c38b1456d4a59c4982db74facaa1722edc18.zip
ffmpeg-streaming-0c39c38b1456d4a59c4982db74facaa1722edc18.tar.gz
add bitrate helper to choose all dnxhd variants
Originally committed as revision 11260 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/dnxhdenc.c')
-rw-r--r--libavcodec/dnxhdenc.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 619e768..9ca842e 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -171,31 +171,12 @@ 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;
- else if (avctx->bit_rate == 185000000)
- ctx->cid = 1243;
- } else {
- if (avctx->bit_rate == 120000000)
- ctx->cid = 1237;
- else if (avctx->bit_rate == 185000000)
- ctx->cid = 1238;
- else if (avctx->bit_rate == 36000000)
- ctx->cid = 1253;
- }
- } 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;
- }
+ ctx->cid = ff_dnxhd_find_cid(avctx);
if (!ctx->cid || avctx->pix_fmt != PIX_FMT_YUV422P) {
av_log(avctx, AV_LOG_ERROR, "video parameters incompatible with DNxHD\n");
return -1;
}
+ av_log(avctx, AV_LOG_DEBUG, "cid %d\n", ctx->cid);
index = ff_dnxhd_get_cid_table(ctx->cid);
ctx->cid_table = &ff_dnxhd_cid_table[index];
OpenPOWER on IntegriCloud