mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit '8941971a8f2e24b9a84fe29f128d13ceb89c0a65'
* commit '8941971a8f2e24b9a84fe29f128d13ceb89c0a65': lavc: make error_rate a private option of mpegvideo encoders Conflicts: libavcodec/options_table.h libavcodec/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
b71e4d8717
|
@ -15,6 +15,10 @@ libavutil: 2012-10-22
|
||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
|
2013-10-xx - xxxxxxx - lavc 55.27.0 - avcodec.h
|
||||||
|
Deprecate AVCodecContext.error_rate, it is replaced by the 'error_rate'
|
||||||
|
private option of the mpegvideo encoder family.
|
||||||
|
|
||||||
2013-11-xx - xxxxxxx - lavc 55.26.0 - vdpau.h
|
2013-11-xx - xxxxxxx - lavc 55.26.0 - vdpau.h
|
||||||
Add av_vdpau_get_profile().
|
Add av_vdpau_get_profile().
|
||||||
Add av_vdpau_alloc_context(). This function must from now on be
|
Add av_vdpau_alloc_context(). This function must from now on be
|
||||||
|
|
|
@ -2833,12 +2833,14 @@ typedef struct AVCodecContext {
|
||||||
uint8_t *subtitle_header;
|
uint8_t *subtitle_header;
|
||||||
int subtitle_header_size;
|
int subtitle_header_size;
|
||||||
|
|
||||||
|
#if FF_API_ERROR_RATE
|
||||||
/**
|
/**
|
||||||
* Simulates errors in the bitstream to test error concealment.
|
* @deprecated use the 'error_rate' private AVOption of the mpegvideo
|
||||||
* - encoding: Set by user.
|
* encoders
|
||||||
* - decoding: unused
|
|
||||||
*/
|
*/
|
||||||
|
attribute_deprecated
|
||||||
int error_rate;
|
int error_rate;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if FF_API_CODEC_PKT
|
#if FF_API_CODEC_PKT
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -747,6 +747,8 @@ typedef struct MpegEncContext {
|
||||||
int context_reinit;
|
int context_reinit;
|
||||||
|
|
||||||
ERContext er;
|
ERContext er;
|
||||||
|
|
||||||
|
int error_rate;
|
||||||
} MpegEncContext;
|
} MpegEncContext;
|
||||||
|
|
||||||
#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
|
#define REBASE_PICTURE(pic, new_ctx, old_ctx) \
|
||||||
|
@ -772,7 +774,9 @@ typedef struct MpegEncContext {
|
||||||
FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
|
FF_MPV_OFFSET(luma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
|
||||||
{ "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
|
{ "chroma_elim_threshold", "single coefficient elimination threshold for chrominance (negative values also consider dc coefficient)",\
|
||||||
FF_MPV_OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
|
FF_MPV_OFFSET(chroma_elim_threshold), AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS },\
|
||||||
{ "quantizer_noise_shaping", NULL, FF_MPV_OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },
|
{ "quantizer_noise_shaping", NULL, FF_MPV_OFFSET(quantizer_noise_shaping), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },\
|
||||||
|
{ "error_rate", "Simulate errors in the bitstream to test error concealment.", \
|
||||||
|
FF_MPV_OFFSET(error_rate), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FF_MPV_OPT_FLAGS },
|
||||||
|
|
||||||
extern const AVOption ff_mpv_generic_options[];
|
extern const AVOption ff_mpv_generic_options[];
|
||||||
|
|
||||||
|
|
|
@ -882,6 +882,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
||||||
if (ff_rate_control_init(s) < 0)
|
if (ff_rate_control_init(s) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
#if FF_API_ERROR_RATE
|
||||||
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
if (avctx->error_rate)
|
||||||
|
s->error_rate = avctx->error_rate;
|
||||||
|
FF_ENABLE_DEPRECATION_WARNINGS;
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2582,9 +2589,9 @@ static int encode_thread(AVCodecContext *c, void *arg){
|
||||||
av_assert2((put_bits_count(&s->pb)&7) == 0);
|
av_assert2((put_bits_count(&s->pb)&7) == 0);
|
||||||
current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
|
current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
|
||||||
|
|
||||||
if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
|
if (s->error_rate && s->resync_mb_x + s->resync_mb_y > 0) {
|
||||||
int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
|
int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
|
||||||
int d= 100 / s->avctx->error_rate;
|
int d = 100 / s->error_rate;
|
||||||
if(r % d == 0){
|
if(r % d == 0){
|
||||||
current_packet_size=0;
|
current_packet_size=0;
|
||||||
s->pb.buf_ptr= s->ptr_lastgob;
|
s->pb.buf_ptr= s->ptr_lastgob;
|
||||||
|
|
|
@ -295,7 +295,9 @@ static const AVOption avcodec_options[] = {
|
||||||
{"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
{"nr", "noise reduction", OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
||||||
{"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},
|
{"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},
|
||||||
{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"},
|
{"flags2", NULL, OFFSET(flags2), AV_OPT_TYPE_FLAGS, {.i64 = DEFAULT}, 0, UINT_MAX, V|A|E|D, "flags2"},
|
||||||
|
#if FF_API_ERROR_RATE
|
||||||
{"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
{"error", NULL, OFFSET(error_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
||||||
|
#endif
|
||||||
{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},
|
{"threads", NULL, OFFSET(thread_count), AV_OPT_TYPE_INT, {.i64 = 1 }, 0, INT_MAX, V|A|E|D, "threads"},
|
||||||
{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
|
{"auto", "autodetect a suitable number of threads to use", 0, AV_OPT_TYPE_CONST, {.i64 = 0 }, INT_MIN, INT_MAX, V|E|D, "threads"},
|
||||||
{"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
{"me_threshold", "motion estimation threshold", OFFSET(me_threshold), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|E},
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
#include "libavutil/avutil.h"
|
#include "libavutil/avutil.h"
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 55
|
#define LIBAVCODEC_VERSION_MAJOR 55
|
||||||
#define LIBAVCODEC_VERSION_MINOR 42
|
#define LIBAVCODEC_VERSION_MINOR 43
|
||||||
#define LIBAVCODEC_VERSION_MICRO 100
|
#define LIBAVCODEC_VERSION_MICRO 100
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
|
@ -120,5 +120,8 @@
|
||||||
#ifndef FF_API_XVMC
|
#ifndef FF_API_XVMC
|
||||||
#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 56)
|
#define FF_API_XVMC (LIBAVCODEC_VERSION_MAJOR < 56)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef FF_API_ERROR_RATE
|
||||||
|
#define FF_API_ERROR_RATE (LIBAVCODEC_VERSION_MAJOR < 56)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* AVCODEC_VERSION_H */
|
#endif /* AVCODEC_VERSION_H */
|
||||||
|
|
Loading…
Reference in New Issue