OLD | NEW |
1 /* | 1 /* |
2 * Rate control for video encoders | 2 * Rate control for video encoders |
3 * | 3 * |
4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> | 4 * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at> |
5 * | 5 * |
6 * This file is part of FFmpeg. | 6 * This file is part of FFmpeg. |
7 * | 7 * |
8 * FFmpeg is free software; you can redistribute it and/or | 8 * FFmpeg is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
11 * version 2.1 of the License, or (at your option) any later version. | 11 * version 2.1 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * FFmpeg is distributed in the hope that it will be useful, | 13 * FFmpeg is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Lesser General Public License for more details. | 16 * Lesser General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Lesser General Public | 18 * You should have received a copy of the GNU Lesser General Public |
19 * License along with FFmpeg; if not, write to the Free Software | 19 * License along with FFmpeg; if not, write to the Free Software |
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21 */ | 21 */ |
22 | 22 |
23 /** | 23 /** |
24 * @file libavcodec/ratecontrol.c | 24 * @file libavcodec/ratecontrol.c |
25 * Rate control for video encoders. | 25 * Rate control for video encoders. |
26 */ | 26 */ |
27 | 27 |
| 28 #include "libavutil/intmath.h" |
28 #include "avcodec.h" | 29 #include "avcodec.h" |
29 #include "dsputil.h" | 30 #include "dsputil.h" |
30 #include "ratecontrol.h" | 31 #include "ratecontrol.h" |
31 #include "mpegvideo.h" | 32 #include "mpegvideo.h" |
32 #include "eval.h" | 33 #include "eval.h" |
33 | 34 |
34 #undef NDEBUG // Always check asserts, the speed effect is far too small to disa
ble them. | 35 #undef NDEBUG // Always check asserts, the speed effect is far too small to disa
ble them. |
35 #include <assert.h> | 36 #include <assert.h> |
36 | 37 |
37 #ifndef M_E | 38 #ifndef M_E |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
951 "with these parameters.\n"); | 952 "with these parameters.\n"); |
952 return -1; | 953 return -1; |
953 } else if (fabs(expected_bits/all_available_bits - 1.0) > 0.01) { | 954 } else if (fabs(expected_bits/all_available_bits - 1.0) > 0.01) { |
954 av_log(s->avctx, AV_LOG_ERROR, | 955 av_log(s->avctx, AV_LOG_ERROR, |
955 "[lavc rc] Error: 2pass curve failed to converge\n"); | 956 "[lavc rc] Error: 2pass curve failed to converge\n"); |
956 return -1; | 957 return -1; |
957 } | 958 } |
958 | 959 |
959 return 0; | 960 return 0; |
960 } | 961 } |
OLD | NEW |