Changeset 21ae55dcaa809e0f5e6b6e424a6ce2f77966ad19
- Timestamp:
- 19/08/06 23:32:19
(2 years ago)
- Author:
- Dennis van Amerongen <trax@videolan.org>
- git-committer:
- Dennis van Amerongen <trax@videolan.org> 1156023139 +0000
- git-parent:
[3189c99ddc42c7e0b4289b28d1efc99d67c1167e]
- git-author:
- Dennis van Amerongen <trax@videolan.org> 1156023139 +0000
- Message:
* modules/codec/x264.c: cosmetics and added SSIM stats computation option.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| rc10879d |
r21ae55d |
|
| 44 | 44 | #define KEYINT_TEXT N_("Maximum GOP size") |
|---|
| 45 | 45 | #define KEYINT_LONGTEXT N_( "Sets maximum interval between IDR-frames." \ |
|---|
| 46 | | "Larger values save bits, thus improving quality for a given bitrate at " \ |
|---|
| 47 | | "the cost of seeking precision." ) |
|---|
| | 46 | "Larger values save bits, thus improving quality for a given bitrate at " \ |
|---|
| | 47 | "the cost of seeking precision." ) |
|---|
| 48 | 48 | |
|---|
| 49 | 49 | #define MIN_KEYINT_TEXT N_("Minimum GOP size") |
|---|
| … | … | |
| 51 | 51 | "In H.264, I-frames do not necessarily bound a closed GOP because it is " \ |
|---|
| 52 | 52 | "allowable for a P-frame to be predicted from more frames than just the " \ |
|---|
| 53 | | "one frame before it (also see frameref). Therefore, I-frames are not " \ |
|---|
| 54 | | "necessarily seekable. IDR-Frames restrict subsequent P-frames from " \ |
|---|
| 55 | | "referring to any frame prior to the IDR-Frame. \n" \ |
|---|
| | 53 | "one frame before it (also see reference frame option). Therefore, " \ |
|---|
| | 54 | "I-frames are not necessarily seekable. IDR-frames restrict subsequent " \ |
|---|
| | 55 | "P-frames from referring to any frame prior to the IDR-frame. \n" \ |
|---|
| 56 | 56 | "If scenecuts appear within this interval, they are still encoded as " \ |
|---|
| 57 | 57 | "I-frames, but do not start a new GOP." ) |
|---|
| 58 | 58 | |
|---|
| 59 | | #define SCENE_TEXT N_("Extra I-Frames aggressivity" ) |
|---|
| | 59 | #define SCENE_TEXT N_("Extra I-frames aggressivity" ) |
|---|
| 60 | 60 | #define SCENE_LONGTEXT N_( "Scene-cut detection. Controls how " \ |
|---|
| 61 | 61 | "aggressively to insert extra I-frames. With small values of " \ |
|---|
| … | … | |
| 65 | 65 | "I-frame. Large values use more I-frames " \ |
|---|
| 66 | 66 | "than necessary, thus wasting bits. -1 disables scene-cut detection, so " \ |
|---|
| 67 | | "I-frames are be inserted only every other keyint frames, which probably " \ |
|---|
| 68 | | "leads to ugly encoding artifacts. (1-100)." ) |
|---|
| | 67 | "I-frames are inserted only every other keyint frames, which probably " \ |
|---|
| | 68 | "leads to ugly encoding artifacts. Range 1 to 100." ) |
|---|
| 69 | 69 | |
|---|
| 70 | 70 | #define BFRAMES_TEXT N_("B-frames between I and P") |
|---|
| 71 | 71 | #define BFRAMES_LONGTEXT N_( "Number of consecutive B-frames between I and " \ |
|---|
| 72 | | "P-frames. (1 to 16)" ) |
|---|
| 73 | | |
|---|
| 74 | | /// \bug [String] extra space |
|---|
| | 72 | "P-frames. Range 1 to 16." ) |
|---|
| | 73 | |
|---|
| 75 | 74 | #define B_ADAPT_TEXT N_("Adaptive B-frame decision") |
|---|
| 76 | 75 | #define B_ADAPT_LONGTEXT N_( "Force the specified number of " \ |
|---|
| 77 | | "consecutive B-frames to be used, except possibly before an I-frame. " ) |
|---|
| 78 | | |
|---|
| 79 | | /// \bug [String] extra space |
|---|
| | 76 | "consecutive B-frames to be used, except possibly before an I-frame." ) |
|---|
| | 77 | |
|---|
| 80 | 78 | #define B_BIAS_TEXT N_("B-frames usage") |
|---|
| 81 | 79 | #define B_BIAS_LONGTEXT N_( "Bias the choice to use B-frames. Positive values " \ |
|---|
| 82 | | "cause more B-frames, negative values cause less B-frames. " ) |
|---|
| | 80 | "cause more B-frames, negative values cause less B-frames." ) |
|---|
| 83 | 81 | |
|---|
| 84 | 82 | #define BPYRAMID_TEXT N_("Keep some B-frames as references") |
|---|
| … | … | |
| 90 | 88 | #define CABAC_LONGTEXT N_( "CABAC (Context-Adaptive Binary Arithmetic "\ |
|---|
| 91 | 89 | "Coding). Slightly slows down encoding and decoding, but should save " \ |
|---|
| 92 | | "10-15% bitrate." ) |
|---|
| 93 | | /// \bug [String] Missing final dot |
|---|
| | 90 | "10 to 15% bitrate." ) |
|---|
| | 91 | |
|---|
| 94 | 92 | #define REF_TEXT N_("Number of reference frames") |
|---|
| 95 | 93 | #define REF_LONGTEXT N_( "Number of previous frames used as predictors. " \ |
|---|
| 96 | 94 | "This is effective in Anime, but seems to make little difference in " \ |
|---|
| 97 | 95 | "live-action source material. Some decoders are unable to deal with " \ |
|---|
| 98 | | "large frameref values. From 1 to 16" ) |
|---|
| | 96 | "large frameref values. Range 1 to 16." ) |
|---|
| 99 | 97 | |
|---|
| 100 | 98 | #define NF_TEXT N_("Skip loop filter") |
|---|
| … | … | |
| 111 | 109 | #define QP_LONGTEXT N_( "This selects the quantizer to use. " \ |
|---|
| 112 | 110 | "Lower values result in better fidelity, but higher bitrates. 26 is a " \ |
|---|
| 113 | | "good default value. From 0 to 51. 0 means lossless" ) |
|---|
| 114 | | |
|---|
| 115 | | /// \bug [String] missing point |
|---|
| | 111 | "good default value. Range 0 (lossless) to 51." ) |
|---|
| | 112 | |
|---|
| 116 | 113 | #define CRF_TEXT N_("Quality-based VBR") |
|---|
| 117 | | #define CRF_LONGTEXT N_( "1-pass Quality-based VBR. From 0 to 51" ) |
|---|
| | 114 | #define CRF_LONGTEXT N_( "1-pass Quality-based VBR. Range 0 to 51." ) |
|---|
| 118 | 115 | |
|---|
| 119 | 116 | #define QPMIN_TEXT N_("Min QP") |
|---|
| 120 | | #define QPMIN_LONGTEXT N_( "Minimum quantizer, 15/35 seems to be a useful " \ |
|---|
| 121 | | "range." ) |
|---|
| 122 | | |
|---|
| 123 | | /// \bug [String] typo ? Why doesn't it work in po ? |
|---|
| | 117 | #define QPMIN_LONGTEXT N_( "Minimum quantizer parameter. 15 to 35 seems to " \ |
|---|
| | 118 | "be a useful range." ) |
|---|
| | 119 | |
|---|
| 124 | 120 | #define QPMAX_TEXT N_("Max QP") |
|---|
| 125 | 121 | #define QPMAX_LONGTEXT N_( "Maximum quantizer parameter." ) |
|---|
| … | … | |
| 129 | 125 | |
|---|
| 130 | 126 | #define RATETOL_TEXT N_("Average bitrate tolerance") |
|---|
| 131 | | #define RATETOL_LONGTEXT N_( "Allowed variance in average. " \ |
|---|
| | 127 | #define RATETOL_LONGTEXT N_( "Allowed variance in average " \ |
|---|
| 132 | 128 | "bitrate (in kbits/s).") |
|---|
| 133 | 129 | |
|---|
| 134 | 130 | #define VBV_MAXRATE_TEXT N_("Max local bitrate") |
|---|
| 135 | | #define VBV_MAXRATE_LONGTEXT N_( "Sets a maximum local bitrate in kbits/s.") |
|---|
| | 131 | #define VBV_MAXRATE_LONGTEXT N_( "Sets a maximum local bitrate (in kbits/s).") |
|---|
| 136 | 132 | |
|---|
| 137 | 133 | #define VBV_BUFSIZE_TEXT N_("VBV buffer") |
|---|
| 138 | 134 | #define VBV_BUFSIZE_LONGTEXT N_( "Averaging period for the maximum " \ |
|---|
| 139 | | "local bitrate in kbits.") |
|---|
| | 135 | "local bitrate (in kbits).") |
|---|
| 140 | 136 | |
|---|
| 141 | 137 | #define VBV_INIT_TEXT N_("Initial VBV buffer occupancy") |
|---|
| 142 | 138 | #define VBV_INIT_LONGTEXT N_( "Sets the initial buffer occupancy as a " \ |
|---|
| 143 | | "fraction of the buffer size.") |
|---|
| 144 | | |
|---|
| | 139 | "fraction of the buffer size. Range 0.0 to 1.0.") |
|---|
| | 140 | |
|---|
| | 141 | /* IP Ratio < 1 is technically valid but should never improve quality */ |
|---|
| 145 | 142 | #define IPRATIO_TEXT N_("QP factor between I and P") |
|---|
| 146 | | #define IPRATIO_LONGTEXT N_( "QP factor between I and P.") |
|---|
| 147 | | |
|---|
| | 143 | #define IPRATIO_LONGTEXT N_( "QP factor between I and P. Range 1.0 to 2.0.") |
|---|
| | 144 | |
|---|
| | 145 | /* PB ratio < 1 is not valid and breaks ratecontrol */ |
|---|
| 148 | 146 | #define PBRATIO_TEXT N_("QP factor between P and B") |
|---|
| 149 | | #define PBRATIO_LONGTEXT N_( "QP factor between P and B.") |
|---|
| | 147 | #define PBRATIO_LONGTEXT N_( "QP factor between P and B. Range 1.0 to 2.0.") |
|---|
| 150 | 148 | |
|---|
| 151 | 149 | #define CHROMA_QP_OFFSET_TEXT N_("QP difference between chroma and luma") |
|---|
| … | … | |
| 153 | 151 | |
|---|
| 154 | 152 | #define QCOMP_TEXT N_("QP curve compression") |
|---|
| 155 | | #define QCOMP_LONGTEXT N_( "QP curve compression. (0.0=CBR to 1.0=QCP)") |
|---|
| | 153 | #define QCOMP_LONGTEXT N_( "QP curve compression. Range 0.0 (CBR) to 1.0 (QCP).") |
|---|
| 156 | 154 | |
|---|
| 157 | 155 | #define CPLXBLUR_TEXT N_("Reduce fluctuations in QP") |
|---|
| 158 | 156 | #define CPLXBLUR_LONGTEXT N_( "This reduces the fluctuations in QP " \ |
|---|
| 159 | | "before curve compression. Temporally blurs complexity.") |
|---|
| | 157 | "before curve compression. Temporally blurs complexity.") |
|---|
| 160 | 158 | |
|---|
| 161 | 159 | #define QBLUR_TEXT N_("Reduce fluctuations in QP") |
|---|
| 162 | 160 | #define QBLUR_LONGTEXT N_( "This reduces the fluctations in QP " \ |
|---|
| 163 | | "after curve compression. Temporally blurs quants.") |
|---|
| | 161 | "after curve compression. Temporally blurs quants.") |
|---|
| 164 | 162 | |
|---|
| 165 | 163 | /* Analysis */ |
|---|
| … | … | |
| 174 | 172 | "(p4x4 requires p8x8. i8x8 requires 8x8dct).") |
|---|
| 175 | 173 | |
|---|
| 176 | | /// \bug [String] Extra space |
|---|
| 177 | 174 | #define DIRECT_PRED_TEXT N_("Direct MV prediction mode") |
|---|
| 178 | | #define DIRECT_PRED_LONGTEXT N_( "Direct MV prediction mode. ") |
|---|
| | 175 | #define DIRECT_PRED_LONGTEXT N_( "Direct MV prediction mode.") |
|---|
| 179 | 176 | |
|---|
| 180 | 177 | #define WEIGHTB_TEXT N_("Weighted prediction for B-frames") |
|---|
| … | … | |
| 191 | 188 | #define MERANGE_LONGTEXT N_( "Maximum distance to search for " \ |
|---|
| 192 | 189 | "motion estimation, measured from predicted position(s). " \ |
|---|
| 193 | | "Default of 16 is good for most footage, "\ |
|---|
| 194 | | "high motion sequences may benefit from settings between 24-32. " \ |
|---|
| 195 | | "From 0 to 64." ) |
|---|
| | 190 | "Default of 16 is good for most footage, high motion sequences may " \ |
|---|
| | 191 | "benefit from settings between 24 and 32. Range 0 to 64." ) |
|---|
| 196 | 192 | |
|---|
| 197 | 193 | #define SUBME_TEXT N_("Subpixel motion estimation and partition decision " \ |
|---|
| … | … | |
| 214 | 210 | #endif |
|---|
| 215 | 211 | |
|---|
| 216 | | #define B_RDO_TEXT N_("RD based mode decision for B-frames.") |
|---|
| | 212 | #define B_RDO_TEXT N_("RD based mode decision for B-frames") |
|---|
| 217 | 213 | #define B_RDO_LONGTEXT N_( "RD based mode decision for B-frames. This " \ |
|---|
| 218 | | "requires subme 6.") |
|---|
| | 214 | "requires subme 6 (or higher).") |
|---|
| 219 | 215 | |
|---|
| 220 | 216 | #define MIXED_REFS_TEXT N_("Decide references on a per partition basis") |
|---|
| 221 | 217 | #define MIXED_REFS_LONGTEXT N_( "Allows each 8x8 or 16x8 partition to " \ |
|---|
| 222 | | "independently " \ |
|---|
| 223 | | "select a reference frame, as opposed to only one ref per macroblock." ) |
|---|
| | 218 | "independently select a reference frame, as opposed to only one ref " \ |
|---|
| | 219 | "per macroblock." ) |
|---|
| 224 | 220 | |
|---|
| 225 | 221 | #define CHROMA_ME_TEXT N_("Ignore chroma in motion estimation") |
|---|
| 226 | 222 | #define CHROMA_ME_LONGTEXT N_( "Chroma ME for subpel and mode decision in " \ |
|---|
| 227 | | "P-frames.") |
|---|
| | 223 | "P-frames.") |
|---|
| 228 | 224 | |
|---|
| 229 | 225 | #define BIME_TEXT N_("Jointly optimize both MVs in B-frames") |
|---|
| … | … | |
| 232 | 228 | #define TRANSFORM_8X8DCT_TEXT N_("Adaptive spatial transform size") |
|---|
| 233 | 229 | #define TRANSFORM_8X8DCT_LONGTEXT N_( \ |
|---|
| 234 | | "SATD-based decision for 8x8 transform in inter-MBs.") |
|---|
| | 230 | "SATD-based decision for 8x8 transform in inter-MBs.") |
|---|
| 235 | 231 | |
|---|
| 236 | 232 | #define TRELLIS_TEXT N_("Trellis RD quantization" ) |
|---|
| 237 | 233 | #define TRELLIS_LONGTEXT N_( "Trellis RD quantization: \n" \ |
|---|
| 238 | | " - 0: disabled\n" \ |
|---|
| 239 | | " - 1: enabled only on the final encode of a MB\n" \ |
|---|
| 240 | | " - 2: enabled on all mode decisions\n" \ |
|---|
| 241 | | "This requires CABAC." ) |
|---|
| | 234 | " - 0: disabled\n" \ |
|---|
| | 235 | " - 1: enabled only on the final encode of a MB\n" \ |
|---|
| | 236 | " - 2: enabled on all mode decisions\n" \ |
|---|
| | 237 | "This requires CABAC." ) |
|---|
| 242 | 238 | |
|---|
| 243 | 239 | #define FAST_PSKIP_TEXT N_("Early SKIP detection on P-frames") |
|---|
| … | … | |
| 248 | 244 | "Eliminate dct blocks containing only a small single coefficient.") |
|---|
| 249 | 245 | |
|---|
| | 246 | /* Noise reduction 1 is too weak to measure, suggest at least 10 */ |
|---|
| 250 | 247 | #define NR_TEXT N_("Noise reduction") |
|---|
| 251 | | #define NR_LONGTEXT N_( "Dct-domain noise reduction. Adaptive pseudo-deadzone.") |
|---|
| | 248 | #define NR_LONGTEXT N_( "Dct-domain noise reduction. Adaptive pseudo-deadzone. " \ |
|---|
| | 249 | "10 to 1000 seems to be a useful range." ) |
|---|
| 252 | 250 | |
|---|
| 253 | 251 | /* Input/Output */ |
|---|
| … | … | |
| 256 | 254 | #define ASM_LONGTEXT N_( "Use assembler CPU optimizations.") |
|---|
| 257 | 255 | |
|---|
| 258 | | #define PSNR_TEXT N_("PSNR calculation") |
|---|
| 259 | | #define PSNR_LONGTEXT N_( "This has no effect on actual encoding quality, "\ |
|---|
| 260 | | "it just prevents the stats from being calculated (for speed)." ) |
|---|
| | 256 | #define PSNR_TEXT N_("PSNR computation") |
|---|
| | 257 | #define PSNR_LONGTEXT N_( "Compute and print PSNR stats. This has no effect on " \ |
|---|
| | 258 | "the actual encoding quality." ) |
|---|
| | 259 | |
|---|
| | 260 | #define SSIM_TEXT N_("SSIM computation") |
|---|
| | 261 | #define SSIM_LONGTEXT N_( "Compute and print SSIM stats. This has no effect on " \ |
|---|
| | 262 | "the actual encoding quality." ) |
|---|
| 261 | 263 | |
|---|
| 262 | 264 | #define QUIET_TEXT N_("Quiet mode") |
|---|
| … | … | |
| 385 | 387 | add_float( SOUT_CFG_PREFIX "ipratio", 1.40, NULL, IPRATIO_TEXT, |
|---|
| 386 | 388 | IPRATIO_LONGTEXT, VLC_FALSE ); |
|---|
| 387 | | change_float_range( 0, 100 ); |
|---|
| | 389 | change_float_range( 1, 2 ); |
|---|
| 388 | 390 | |
|---|
| 389 | 391 | add_float( SOUT_CFG_PREFIX "pbratio", 1.30, NULL, PBRATIO_TEXT, |
|---|
| 390 | 392 | PBRATIO_LONGTEXT, VLC_FALSE ); |
|---|
| 391 | | change_float_range( 0, 100 ); |
|---|
| | 393 | change_float_range( 1, 2 ); |
|---|
| 392 | 394 | |
|---|
| 393 | 395 | #if X264_BUILD >= 23 /* r190 */ |
|---|
| … | … | |
| 481 | 483 | add_integer( SOUT_CFG_PREFIX "nr", 0, NULL, NR_TEXT, |
|---|
| 482 | 484 | NR_LONGTEXT, VLC_FALSE ); |
|---|
| | 485 | change_integer_range( 0, 1000 ); |
|---|
| 483 | 486 | #endif |
|---|
| 484 | 487 | |
|---|
| … | … | |
| 488 | 491 | ASM_LONGTEXT, VLC_FALSE ); |
|---|
| 489 | 492 | |
|---|
| 490 | | /* x264 psnr = 1 (default). disable PSNR calculation for speed. */ |
|---|
| | 493 | /* x264 psnr = 1 (default). disable PSNR computation for speed. */ |
|---|
| 491 | 494 | add_bool( SOUT_CFG_PREFIX "psnr", 0, NULL, PSNR_TEXT, |
|---|
| 492 | 495 | PSNR_LONGTEXT, VLC_FALSE ); |
|---|
| | 496 | |
|---|
| | 497 | #if X264_BUILD >= 50 /* r554 */ |
|---|
| | 498 | /* x264 ssim = 1 (default). disable SSIM computation for speed. */ |
|---|
| | 499 | add_bool( SOUT_CFG_PREFIX "ssim", 0, NULL, SSIM_TEXT, |
|---|
| | 500 | SSIM_LONGTEXT, VLC_FALSE ); |
|---|
| | 501 | #endif |
|---|
| 493 | 502 | |
|---|
| 494 | 503 | add_bool( SOUT_CFG_PREFIX "quiet", 0, NULL, QUIET_TEXT, |
|---|
| … | … | |
| 512 | 521 | "min-keyint", "mixed-refs", "nf", "nr", "pbratio", "psnr", "qblur", |
|---|
| 513 | 522 | "qp", "qcomp", "qpstep", "qpmax", "qpmin", "qp-max", "qp-min", "quiet", |
|---|
| 514 | | "ratetol", "ref", "scenecut", "subme", "subpel", "tolerance", |
|---|
| | 523 | "ratetol", "ref", "scenecut", "ssim", "subme", "subpel", "tolerance", |
|---|
| 515 | 524 | "trellis", "verbose", "vbv-bufsize", "vbv-init", "vbv-maxrate", |
|---|
| 516 | 525 | "weightb", NULL |
|---|
| … | … | |
| 650 | 659 | var_Get( p_enc, SOUT_CFG_PREFIX "nf", &val ); |
|---|
| 651 | 660 | p_sys->param.b_deblocking_filter = !val.b_bool; |
|---|
| 652 | | |
|---|
| | 661 | |
|---|
| 653 | 662 | var_Get( p_enc, SOUT_CFG_PREFIX "filter", &val ); |
|---|
| 654 | 663 | if( val.psz_string ) |
|---|
| … | … | |
| 769 | 778 | p_sys->param.analyse.b_psnr = val.b_bool; |
|---|
| 770 | 779 | |
|---|
| | 780 | #if X264_BUILD >= 50 /* r554 */ |
|---|
| | 781 | var_Get( p_enc, SOUT_CFG_PREFIX "ssim", &val ); |
|---|
| | 782 | p_sys->param.analyse.b_ssim = val.b_bool; |
|---|
| | 783 | #endif |
|---|
| | 784 | |
|---|
| 771 | 785 | #if X264_BUILD >= 0x0012 |
|---|
| 772 | 786 | var_Get( p_enc, SOUT_CFG_PREFIX "weightb", &val ); |
|---|
| … | … | |
| 829 | 843 | #if X264_BUILD >= 44 |
|---|
| 830 | 844 | var_Get( p_enc, SOUT_CFG_PREFIX "nr", &val ); |
|---|
| 831 | | p_sys->param.analyse.i_noise_reduction = val.i_int; |
|---|
| | 845 | if( val.i_int >= 0 && val.i_int <= 1000 ) |
|---|
| | 846 | p_sys->param.analyse.i_noise_reduction = val.i_int; |
|---|
| 832 | 847 | #endif |
|---|
| 833 | 848 | |
|---|
| … | … | |
| 925 | 940 | |
|---|
| 926 | 941 | #if X264_BUILD >= 29 |
|---|
| | 942 | /* As of r543 x264 will autodetect the number of cpus and will set |
|---|
| | 943 | the number of threads accordingly unless ofcourse the number of |
|---|
| | 944 | threads is explicitly specified... */ |
|---|
| 927 | 945 | if( p_enc->i_threads >= 1 ) |
|---|
| 928 | 946 | p_sys->param.i_threads = p_enc->i_threads; |
|---|