History

Merge commit '8941971a8f2e24b9a84fe29f128d13ceb89c0a65'

* commit '8941971a8f2e24b9a84fe29f128d13ceb89c0a65': lavc: make error_rate a private option of mpegvideo encoders Conflicts: libavcodec/options_table.h libavcodec/version.h

Michael Niedermayer committed 13 years ago

Commit b71e4d82 parents 31c09b7 89419716 files · +29 −7Browse files

Unified · Split

6 files
  1. doc/APIchanges +4 −0
  2. libavcodec/avcodec.h +5 −3
  3. libavcodec/mpegvideo.h +5 −1
  4. libavcodec/mpegvideo_enc.c +9 −2
  5. libavcodec/options_table.h +2 −0
  6. libavcodec/version.h +4 −1
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2012-10-22 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2013-10-xx - xxxxxxx - lavc 55.27.0 - avcodec.h
19+ Deprecate AVCodecContext.error_rate, it is replaced by the 'error_rate'
20+ private option of the mpegvideo encoder family.
21+
1822 2013-11-xx - xxxxxxx - lavc 55.26.0 - vdpau.h
1923 Add av_vdpau_get_profile().
2024 Add av_vdpau_alloc_context(). This function must from now on be
libavcodec/avcodec.h+5−3
@@ -2833,12 +2833,14 @@ typedef struct AVCodecContext { · 2832 unmodified lines
28332833 uint8_t *subtitle_header;
28342834 int subtitle_header_size;
28352835
2836+#if FF_API_ERROR_RATE
28362837 /**
2837− * Simulates errors in the bitstream to test error concealment.
2838− * - encoding: Set by user.
2839− * - decoding: unused
2838+ * @deprecated use the 'error_rate' private AVOption of the mpegvideo
2839+ * encoders
28402840 */
2841+ attribute_deprecated
28412842 int error_rate;
2843+#endif
28422844
28432845 #if FF_API_CODEC_PKT
28442846 /**
libavcodec/mpegvideo.h+5−1
@@ -747,6 +747,8 @@ typedef struct MpegEncContext { · 746 unmodified lines
747747 int context_reinit;
748748
749749 ERContext er;
750+
751+ int error_rate;
750752 } MpegEncContext;
751753
752754 #define REBASE_PICTURE(pic, new_ctx, old_ctx) \
@@ -772,7 +774,9 @@ typedef struct MpegEncContext { · 19 unmodified lines
772774 FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
773775 { "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
774776 FF_MPV_OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
775−{ "quantizer_noise_shaping", NULL, FF_MPV_OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },
777+{ "quantizer_noise_shaping", NULL, FF_MPV_OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },\
778+{ "error_rate", "Simulate errors in the bitstream to test error concealment.", \
779+ FF_MPV_OFFSET(error_rate), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },
776780
777781 extern const AVOption ff_mpv_generic_options[];
778782
libavcodec/mpegvideo_enc.c+9−2
@@ -882,6 +882,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) · 881 unmodified lines
882882 if (ff_rate_control_init(s) < 0)
883883 return -1;
884884
885+#if FF_API_ERROR_RATE
886+ FF_DISABLE_DEPRECATION_WARNINGS
887+ if (avctx->error_rate)
888+ s->error_rate = avctx->error_rate;
889+ FF_ENABLE_DEPRECATION_WARNINGS;
890+#endif
891+
885892 return 0;
886893 }
887894
@@ -2582,9 +2589,9 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 1694 unmodified lines
25822589 av_assert2((put_bits_count(&s->pb)&7) == 0);
25832590 current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
25842591
2585− if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
2592+ if (s->error_rate && s->resync_mb_x + s->resync_mb_y > 0) {
25862593 int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
2587− int d= 100 / s->avctx->error_rate;
2594+ int d = 100 / s->error_rate;
25882595 if(r % d == 0){
25892596 current_packet_size=0;
25902597 s->pb.buf_ptr= s->ptr_lastgob;
libavcodec/options_table.h+2−0
@@ -295,7 +295,9 @@ static const AVOption avcodec_options[] = { · 294 unmodified lines
295295 {"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
296296 {"rc_init_occupancy", "number of bits which should be loaded into the rc buffer before decoding starts", OFFSET(rc_initial_buffer_occupancy), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
297297 {"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"},
298+#if FF_API_ERROR_RATE
298299 {"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
300+#endif
299301 {"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},
300302 {"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
301303 {"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
libavcodec/version.h+4−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
2929 #include "libavutil/avutil.h"
3030
3131 #define LIBAVCODEC_VERSION_MAJOR 55
32−#define LIBAVCODEC_VERSION_MINOR 42
32+#define LIBAVCODEC_VERSION_MINOR 43
3333 #define LIBAVCODEC_VERSION_MICRO 100
3434
3535 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -120,5 +120,8 @@ · 84 unmodified lines
120120 #ifndef FF_API_XVMC
121121 #define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 56)
122122 #endif
123+#ifndef FF_API_ERROR_RATE
124+#define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 56)
125+#endif
123126
124127 #endif /* AVCODEC_VERSION_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t