Mercurial > mplayer.hg
comparison libmpcodecs/ve_xvid4.c @ 13675:d4cba4c4c54c
Bitrate setting option in ve_xvid4.c doesn't follow the rules described
in manpage (i.e. if bitrate > 16000, then it's in bits/s, not kbits),
unlike lavc and the old ve_xvid.c do. Fixed.
author | rathann |
---|---|
date | Mon, 18 Oct 2004 20:00:07 +0000 |
parents | b79ee5bf2c9e |
children | 5a786c7e4df4 |
comparison
equal
deleted
inserted
replaced
13674:b7322244e53c | 13675:d4cba4c4c54c |
---|---|
672 | 672 |
673 /* ------------------------------------------------------------------- | 673 /* ------------------------------------------------------------------- |
674 * The single pass plugin | 674 * The single pass plugin |
675 * ---------------------------------------------------------------- */ | 675 * ---------------------------------------------------------------- */ |
676 | 676 |
677 onepass->bitrate = xvidenc_bitrate; | 677 if (xvidenc_bitrate > 16000) onepass->bitrate = xvidenc_bitrate; |
678 else onepass->bitrate = xvidenc_bitrate*1000; | |
678 onepass->reaction_delay_factor = xvidenc_cbr_reaction_delay_factor; | 679 onepass->reaction_delay_factor = xvidenc_cbr_reaction_delay_factor; |
679 onepass->averaging_period = xvidenc_cbr_averaging_period; | 680 onepass->averaging_period = xvidenc_cbr_averaging_period; |
680 onepass->buffer = xvidenc_cbr_buffer; | 681 onepass->buffer = xvidenc_cbr_buffer; |
681 | 682 |
682 /* ------------------------------------------------------------------- | 683 /* ------------------------------------------------------------------- |
947 if(pass == MODE_CBR || pass == MODE_QUANT) { | 948 if(pass == MODE_CBR || pass == MODE_QUANT) { |
948 xvid_plugin_single_t *onepass = &mod->onepass; | 949 xvid_plugin_single_t *onepass = &mod->onepass; |
949 | 950 |
950 /* There is not much left to initialize after dispatch settings */ | 951 /* There is not much left to initialize after dispatch settings */ |
951 onepass->version = XVID_VERSION; | 952 onepass->version = XVID_VERSION; |
952 onepass->bitrate = xvidenc_bitrate*1000; | 953 if (xvidenc_bitrate > 16000) onepass->bitrate = xvidenc_bitrate; |
954 else onepass->bitrate = xvidenc_bitrate*1000; | |
953 | 955 |
954 /* Quantizer mode uses the same plugin, we have only to define | 956 /* Quantizer mode uses the same plugin, we have only to define |
955 * a constant quantizer zone beginning at frame 0 */ | 957 * a constant quantizer zone beginning at frame 0 */ |
956 if(pass == MODE_QUANT) { | 958 if(pass == MODE_QUANT) { |
957 XVIDRational squant; | 959 XVIDRational squant; |
970 (float)(squant.num)/(float)(squant.den)); | 972 (float)(squant.num)/(float)(squant.den)); |
971 | 973 |
972 } else { | 974 } else { |
973 mp_msg(MSGT_MENCODER, MSGL_INFO, | 975 mp_msg(MSGT_MENCODER, MSGL_INFO, |
974 "xvid: CBR Rate Control -- bitrate=%dkbit/s\n", | 976 "xvid: CBR Rate Control -- bitrate=%dkbit/s\n", |
975 xvidenc_bitrate); | 977 xvidenc_bitrate>16000?xvidenc_bitrate/1000:xvidenc_bitrate); |
976 } | 978 } |
977 | 979 |
978 create->plugins[create->num_plugins].func = xvid_plugin_single; | 980 create->plugins[create->num_plugins].func = xvid_plugin_single; |
979 create->plugins[create->num_plugins].param = onepass; | 981 create->plugins[create->num_plugins].param = onepass; |
980 create->num_plugins++; | 982 create->num_plugins++; |
1006 | 1008 |
1007 /* Positive bitrate values are bitrates as usual but if the | 1009 /* Positive bitrate values are bitrates as usual but if the |
1008 * value is negative it is considered as being a total size | 1010 * value is negative it is considered as being a total size |
1009 * to reach (in kilobytes) */ | 1011 * to reach (in kilobytes) */ |
1010 if(xvidenc_bitrate > 0) { | 1012 if(xvidenc_bitrate > 0) { |
1011 pass2->bitrate = xvidenc_bitrate*1000; | 1013 if(xvidenc_bitrate > 16000) pass2->bitrate = xvidenc_bitrate; |
1014 else pass2->bitrate = xvidenc_bitrate*1000; | |
1012 mp_msg(MSGT_MENCODER, MSGL_INFO, | 1015 mp_msg(MSGT_MENCODER, MSGL_INFO, |
1013 "xvid: 2Pass Rate Control -- 2nd pass -- bitrate=%dkbit/s\n", | 1016 "xvid: 2Pass Rate Control -- 2nd pass -- bitrate=%dkbit/s\n", |
1014 xvidenc_bitrate); | 1017 xvidenc_bitrate>16000?xvidenc_bitrate/1000:xvidenc_bitrate); |
1015 } else { | 1018 } else { |
1016 pass2->bitrate = xvidenc_bitrate; | 1019 pass2->bitrate = xvidenc_bitrate; |
1017 mp_msg(MSGT_MENCODER, MSGL_INFO, | 1020 mp_msg(MSGT_MENCODER, MSGL_INFO, |
1018 "xvid: 2Pass Rate Control -- 2nd pass -- total size=%dkB\n", | 1021 "xvid: 2Pass Rate Control -- 2nd pass -- total size=%dkB\n", |
1019 -xvidenc_bitrate); | 1022 -xvidenc_bitrate); |