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
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182013-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
182013-11-xx - xxxxxxx - lavc 55.26.0 - vdpau.h222013-11-xx - xxxxxxx - lavc 55.26.0 - vdpau.h
19 Add av_vdpau_get_profile().23 Add av_vdpau_get_profile().
20 Add av_vdpau_alloc_context(). This function must from now on be24 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
2833 uint8_t *subtitle_header;2833 uint8_t *subtitle_header;
2834 int subtitle_header_size;2834 int subtitle_header_size;
2835 2835
2836#if FF_API_ERROR_RATE
2836 /**2837 /**
2837 * Simulates errors in the bitstream to test error concealment.2838 * @deprecated use the 'error_rate' private AVOption of the mpegvideo
2838 * - encoding: Set by user.2839 * encoders
2839 * - decoding: unused
2840 */2840 */
2841 attribute_deprecated
2841 int error_rate;2842 int error_rate;
2843#endif
2842 2844
2843#if FF_API_CODEC_PKT2845#if FF_API_CODEC_PKT
2844 /**2846 /**
libavcodec/mpegvideo.h+5−1
@@ -747,6 +747,8 @@ typedef struct MpegEncContext { · 746 unmodified lines
747 int context_reinit;747 int context_reinit;
748 748
749 ERContext er;749 ERContext er;
750
751 int error_rate;
750} MpegEncContext;752} MpegEncContext;
751 753
752#define REBASE_PICTURE(pic, new_ctx, old_ctx) \754#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
@@ -772,7 +774,9 @@ typedef struct MpegEncContext { · 19 unmodified lines
772 FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\774 FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
773{ "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\775{ "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
774 FF_MPV_OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\776 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 },
776 780
777extern const AVOption ff_mpv_generic_options[];781extern const AVOption ff_mpv_generic_options[];
778 782
libavcodec/mpegvideo_enc.c+9−2
@@ -882,6 +882,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx) · 881 unmodified lines
882 if (ff_rate_control_init(s) < 0)882 if (ff_rate_control_init(s) < 0)
883 return -1;883 return -1;
884 884
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
885 return 0;892 return 0;
886}893}
887 894
@@ -2582,9 +2589,9 @@ static int encode_thread(AVCodecContext *c, void *arg){ · 1694 unmodified lines
2582 av_assert2((put_bits_count(&s->pb)&7) == 0);2589 av_assert2((put_bits_count(&s->pb)&7) == 0);
2583 current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;2590 current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
2584 2591
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) {
2586 int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;2593 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;
2588 if(r % d == 0){2595 if(r % d == 0){
2589 current_packet_size=0;2596 current_packet_size=0;
2590 s->pb.buf_ptr= s->ptr_lastgob;2597 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
295{"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},295{"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
296{"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},296{"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},
297{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"},297{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"},
298#if FF_API_ERROR_RATE
298{"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},299{"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
300#endif
299{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},301{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},
300{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},302{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
301{"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},303{"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
29#include "libavutil/avutil.h"29#include "libavutil/avutil.h"
30 30
31#define LIBAVCODEC_VERSION_MAJOR 5531#define LIBAVCODEC_VERSION_MAJOR 55
32#define LIBAVCODEC_VERSION_MINOR 4232#define LIBAVCODEC_VERSION_MINOR 43
33#define LIBAVCODEC_VERSION_MICRO 10033#define LIBAVCODEC_VERSION_MICRO 100
34 34
35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \35#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
@@ -120,5 +120,8 @@ · 84 unmodified lines
120#ifndef FF_API_XVMC120#ifndef FF_API_XVMC
121#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 56)121#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 56)
122#endif122#endif
123#ifndef FF_API_ERROR_RATE
124#define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 56)
125#endif
123 126
124#endif /* AVCODEC_VERSION_H */127#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