Commit 43c02982 authored by Derek Buitenhuis's avatar Derek Buitenhuis

Merge commit '5b6f42da'

* commit '5b6f42da':
  lavc: Move me_penalty_compensation to codec private options
Merged-by: 's avatarDerek Buitenhuis <derek.buitenhuis@gmail.com>
parents f3af379b 5b6f42da
...@@ -2170,12 +2170,13 @@ typedef struct AVCodecContext { ...@@ -2170,12 +2170,13 @@ typedef struct AVCodecContext {
*/ */
int mb_lmax; int mb_lmax;
#if FF_API_PRIVATE_OPT
/** /**
* * @deprecated use encoder private options instead
* - encoding: Set by user.
* - decoding: unused
*/ */
attribute_deprecated
int me_penalty_compensation; int me_penalty_compensation;
#endif
/** /**
* *
......
...@@ -256,6 +256,7 @@ typedef struct MpegEncContext { ...@@ -256,6 +256,7 @@ typedef struct MpegEncContext {
int me_method; ///< ME algorithm int me_method; ///< ME algorithm
#endif #endif
int motion_est; ///< ME algorithm int motion_est; ///< ME algorithm
int me_penalty_compensation;
int mv_dir; int mv_dir;
#define MV_DIR_FORWARD 1 #define MV_DIR_FORWARD 1
#define MV_DIR_BACKWARD 2 #define MV_DIR_BACKWARD 2
...@@ -649,6 +650,7 @@ FF_MPV_OPT_CMP_FUNC, \ ...@@ -649,6 +650,7 @@ FF_MPV_OPT_CMP_FUNC, \
{"noise_reduction", "Noise reduction", FF_MPV_OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ {"noise_reduction", "Noise reduction", FF_MPV_OFFSET(noise_reduction), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
{"mpeg_quant", "Use MPEG quantizers instead of H.263", FF_MPV_OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \ {"mpeg_quant", "Use MPEG quantizers instead of H.263", FF_MPV_OFFSET(mpeg_quant), AV_OPT_TYPE_INT, {.i64 = 0 }, 0, 1, FF_MPV_OPT_FLAGS }, \
{"ps", "RTP payload size in bytes", FF_MPV_OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \ {"ps", "RTP payload size in bytes", FF_MPV_OFFSET(rtp_payload_size), AV_OPT_TYPE_INT, {.i64 = 0 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
{"mepc", "Motion estimation bitrate penalty compensation (1.0 = 256)", FF_MPV_OFFSET(me_penalty_compensation), AV_OPT_TYPE_INT, {.i64 = 256 }, INT_MIN, INT_MAX, FF_MPV_OPT_FLAGS }, \
extern const AVOption ff_mpv_generic_options[]; extern const AVOption ff_mpv_generic_options[];
......
...@@ -353,6 +353,8 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx) ...@@ -353,6 +353,8 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
FF_DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS
if (avctx->rtp_payload_size) if (avctx->rtp_payload_size)
s->rtp_payload_size = avctx->rtp_payload_size; s->rtp_payload_size = avctx->rtp_payload_size;
if (avctx->me_penalty_compensation)
s->me_penalty_compensation = avctx->me_penalty_compensation;
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif
...@@ -3729,8 +3731,8 @@ static int encode_picture(MpegEncContext *s, int picture_number) ...@@ -3729,8 +3731,8 @@ static int encode_picture(MpegEncContext *s, int picture_number)
/* Estimate motion for every MB */ /* Estimate motion for every MB */
if(s->pict_type != AV_PICTURE_TYPE_I){ if(s->pict_type != AV_PICTURE_TYPE_I){
s->lambda = (s->lambda * s->avctx->me_penalty_compensation + 128)>>8; s->lambda = (s->lambda * s->me_penalty_compensation + 128) >> 8;
s->lambda2= (s->lambda2* (int64_t)s->avctx->me_penalty_compensation + 128)>>8; s->lambda2 = (s->lambda2 * (int64_t) s->me_penalty_compensation + 128) >> 8;
if (s->pict_type != AV_PICTURE_TYPE_B) { if (s->pict_type != AV_PICTURE_TYPE_B) {
if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){ if((s->avctx->pre_me && s->last_non_b_pict_type==AV_PICTURE_TYPE_I) || s->avctx->pre_me==2){
s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*)); s->avctx->execute(s->avctx, pre_estimate_motion_thread, &s->thread_context[0], NULL, context_count, sizeof(void*));
......
...@@ -403,7 +403,9 @@ static const AVOption avcodec_options[] = { ...@@ -403,7 +403,9 @@ static const AVOption avcodec_options[] = {
#endif #endif
{"mblmin", "minimum macroblock Lagrange factor (VBR)", OFFSET(mb_lmin), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 2 }, 1, FF_LAMBDA_MAX, V|E}, {"mblmin", "minimum macroblock Lagrange factor (VBR)", OFFSET(mb_lmin), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 2 }, 1, FF_LAMBDA_MAX, V|E},
{"mblmax", "maximum macroblock Lagrange factor (VBR)", OFFSET(mb_lmax), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 31 }, 1, FF_LAMBDA_MAX, V|E}, {"mblmax", "maximum macroblock Lagrange factor (VBR)", OFFSET(mb_lmax), AV_OPT_TYPE_INT, {.i64 = FF_QP2LAMBDA * 31 }, 1, FF_LAMBDA_MAX, V|E},
#if FF_API_PRIVATE_OPT
{"mepc", "motion estimation bitrate penalty compensation (1.0 = 256)", OFFSET(me_penalty_compensation), AV_OPT_TYPE_INT, {.i64 = 256 }, INT_MIN, INT_MAX, V|E}, {"mepc", "motion estimation bitrate penalty compensation (1.0 = 256)", OFFSET(me_penalty_compensation), AV_OPT_TYPE_INT, {.i64 = 256 }, INT_MIN, INT_MAX, V|E},
#endif
{"skip_loop_filter", "skip loop filtering process for the selected frames", OFFSET(skip_loop_filter), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"skip_loop_filter", "skip loop filtering process for the selected frames", OFFSET(skip_loop_filter), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"skip_idct" , "skip IDCT/dequantization for the selected frames", OFFSET(skip_idct), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"skip_idct" , "skip IDCT/dequantization for the selected frames", OFFSET(skip_idct), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
{"skip_frame" , "skip decoding for the selected frames", OFFSET(skip_frame), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"}, {"skip_frame" , "skip decoding for the selected frames", OFFSET(skip_frame), AV_OPT_TYPE_INT, {.i64 = AVDISCARD_DEFAULT }, INT_MIN, INT_MAX, V|D, "avdiscard"},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment