mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
lavc: move CODEC_FLAG_MV0 to mpegvideo
This commit is contained in:
parent
6484149158
commit
a2941c8cb2
@ -13,6 +13,10 @@ libavutil: 2013-12-xx
|
|||||||
|
|
||||||
API changes, most recent first:
|
API changes, most recent first:
|
||||||
|
|
||||||
|
2014-04-xx - xxxxxxx - lavc 55.50.3 - avcodec.h
|
||||||
|
Deprecate CODEC_FLAG_MV0. It is replaced by the flag "mv0" in the
|
||||||
|
"mpv_flags" private option of the mpegvideo encoders.
|
||||||
|
|
||||||
2014-04-xx - xxxxxxx - lavc 55.50.2 - avcodec.h
|
2014-04-xx - xxxxxxx - lavc 55.50.2 - avcodec.h
|
||||||
Deprecate CODEC_FLAG_GMC. It is replaced by the "gmc" private option of the
|
Deprecate CODEC_FLAG_GMC. It is replaced by the "gmc" private option of the
|
||||||
libxvid encoder.
|
libxvid encoder.
|
||||||
|
@ -675,7 +675,13 @@ typedef struct RcOverride{
|
|||||||
*/
|
*/
|
||||||
#define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
|
#define CODEC_FLAG_GMC 0x0020 ///< Use GMC.
|
||||||
#endif
|
#endif
|
||||||
#define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>.
|
#if FF_API_MV0
|
||||||
|
/**
|
||||||
|
* @deprecated use the flag "mv0" in the "mpv_flags" private option of the
|
||||||
|
* mpegvideo encoders
|
||||||
|
*/
|
||||||
|
#define CODEC_FLAG_MV0 0x0040
|
||||||
|
#endif
|
||||||
#if FF_API_INPUT_PRESERVED
|
#if FF_API_INPUT_PRESERVED
|
||||||
/**
|
/**
|
||||||
* @deprecated passing reference-counted frames to the encoders replaces this
|
* @deprecated passing reference-counted frames to the encoders replaces this
|
||||||
|
@ -973,7 +973,7 @@ void ff_estimate_p_frame_motion(MpegEncContext * s,
|
|||||||
// if (varc*2 + 200*256 + 50*(s->lambda2>>FF_LAMBDA_SHIFT) > vard){
|
// if (varc*2 + 200*256 + 50*(s->lambda2>>FF_LAMBDA_SHIFT) > vard){
|
||||||
mb_type|= CANDIDATE_MB_TYPE_INTER;
|
mb_type|= CANDIDATE_MB_TYPE_INTER;
|
||||||
c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
|
c->sub_motion_search(s, &mx, &my, dmin, 0, 0, 0, 16);
|
||||||
if(s->flags&CODEC_FLAG_MV0)
|
if (s->mpv_flags & FF_MPV_FLAG_MV0)
|
||||||
if(mx || my)
|
if(mx || my)
|
||||||
mb_type |= CANDIDATE_MB_TYPE_SKIPPED; //FIXME check difference
|
mb_type |= CANDIDATE_MB_TYPE_SKIPPED; //FIXME check difference
|
||||||
}else{
|
}else{
|
||||||
@ -1592,7 +1592,8 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
|
|||||||
}
|
}
|
||||||
//FIXME something smarter
|
//FIXME something smarter
|
||||||
if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //do not try direct mode if it is invalid for this MB
|
if(dmin>256*256*16) type&= ~CANDIDATE_MB_TYPE_DIRECT; //do not try direct mode if it is invalid for this MB
|
||||||
if(s->codec_id == AV_CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT && s->flags&CODEC_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy])
|
if (s->codec_id == AV_CODEC_ID_MPEG4 && type&CANDIDATE_MB_TYPE_DIRECT &&
|
||||||
|
s->mpv_flags & FF_MPV_FLAG_MV0 && *(uint32_t*)s->b_direct_mv_table[xy])
|
||||||
type |= CANDIDATE_MB_TYPE_DIRECT0;
|
type |= CANDIDATE_MB_TYPE_DIRECT0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -896,7 +896,8 @@ static av_always_inline int epzs_motion_search_internal(MpegEncContext * s, int
|
|||||||
score_map[0]= dmin;
|
score_map[0]= dmin;
|
||||||
|
|
||||||
//FIXME precalc first term below?
|
//FIXME precalc first term below?
|
||||||
if((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) || s->flags&CODEC_FLAG_MV0)
|
if ((s->pict_type == AV_PICTURE_TYPE_B && !(c->flags & FLAG_DIRECT)) ||
|
||||||
|
s->mpv_flags & FF_MPV_FLAG_MV0)
|
||||||
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
|
dmin += (mv_penalty[pred_x] + mv_penalty[pred_y])*penalty_factor;
|
||||||
|
|
||||||
/* first line */
|
/* first line */
|
||||||
|
@ -650,6 +650,7 @@ typedef struct MpegEncContext {
|
|||||||
#define FF_MPV_FLAG_QP_RD 0x0004
|
#define FF_MPV_FLAG_QP_RD 0x0004
|
||||||
#define FF_MPV_FLAG_CBP_RD 0x0008
|
#define FF_MPV_FLAG_CBP_RD 0x0008
|
||||||
#define FF_MPV_FLAG_NAQ 0x0010
|
#define FF_MPV_FLAG_NAQ 0x0010
|
||||||
|
#define FF_MPV_FLAG_MV0 0x0020
|
||||||
|
|
||||||
#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
|
#define FF_MPV_OFFSET(x) offsetof(MpegEncContext, x)
|
||||||
#define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
|
#define FF_MPV_OPT_FLAGS (AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM)
|
||||||
@ -660,6 +661,7 @@ typedef struct MpegEncContext {
|
|||||||
{ "qp_rd", "Use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_QP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
|
{ "qp_rd", "Use rate distortion optimization for qp selection", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_QP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
|
||||||
{ "cbp_rd", "use rate distortion optimization for CBP", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_CBP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
|
{ "cbp_rd", "use rate distortion optimization for CBP", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_CBP_RD }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
|
||||||
{ "naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_NAQ }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
|
{ "naq", "normalize adaptive quantization", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_NAQ }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
|
||||||
|
{ "mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, { .i64 = FF_MPV_FLAG_MV0 }, 0, 0, FF_MPV_OPT_FLAGS, "mpv_flags" },\
|
||||||
{ "luma_elim_threshold", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\
|
{ "luma_elim_threshold", "single coefficient elimination threshold for luminance (negative values also consider dc coefficient)",\
|
||||||
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)",\
|
||||||
|
@ -787,6 +787,13 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
|||||||
FF_ENABLE_DEPRECATION_WARNINGS;
|
FF_ENABLE_DEPRECATION_WARNINGS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if FF_API_MV0
|
||||||
|
FF_DISABLE_DEPRECATION_WARNINGS
|
||||||
|
if (avctx->flags & CODEC_FLAG_MV0)
|
||||||
|
s->mpv_flags |= FF_MPV_FLAG_MV0;
|
||||||
|
FF_ENABLE_DEPRECATION_WARNINGS
|
||||||
|
#endif
|
||||||
|
|
||||||
if (avctx->b_frame_strategy == 2) {
|
if (avctx->b_frame_strategy == 2) {
|
||||||
for (i = 0; i < s->max_b_frames + 2; i++) {
|
for (i = 0; i < s->max_b_frames + 2; i++) {
|
||||||
s->tmp_frames[i] = av_frame_alloc();
|
s->tmp_frames[i] = av_frame_alloc();
|
||||||
|
@ -55,7 +55,9 @@ static const AVOption avcodec_options[] = {
|
|||||||
#if FF_API_GMC
|
#if FF_API_GMC
|
||||||
{"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
|
{"gmc", "use gmc", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_GMC }, INT_MIN, INT_MAX, V|E, "flags"},
|
||||||
#endif
|
#endif
|
||||||
|
#if FF_API_MV0
|
||||||
{"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"},
|
{"mv0", "always try a mb with mv=<0,0>", 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_MV0 }, INT_MIN, INT_MAX, V|E, "flags"},
|
||||||
|
#endif
|
||||||
#if FF_API_INPUT_PRESERVED
|
#if FF_API_INPUT_PRESERVED
|
||||||
{"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
|
{"input_preserved", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = CODEC_FLAG_INPUT_PRESERVED }, INT_MIN, INT_MAX, 0, "flags"},
|
||||||
#endif
|
#endif
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#define LIBAVCODEC_VERSION_MAJOR 55
|
#define LIBAVCODEC_VERSION_MAJOR 55
|
||||||
#define LIBAVCODEC_VERSION_MINOR 50
|
#define LIBAVCODEC_VERSION_MINOR 50
|
||||||
#define LIBAVCODEC_VERSION_MICRO 2
|
#define LIBAVCODEC_VERSION_MICRO 3
|
||||||
|
|
||||||
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
|
||||||
LIBAVCODEC_VERSION_MINOR, \
|
LIBAVCODEC_VERSION_MINOR, \
|
||||||
@ -138,5 +138,8 @@
|
|||||||
#ifndef FF_API_GMC
|
#ifndef FF_API_GMC
|
||||||
#define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 57)
|
#define FF_API_GMC (LIBAVCODEC_VERSION_MAJOR < 57)
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef FF_API_MV0
|
||||||
|
#define FF_API_MV0 (LIBAVCODEC_VERSION_MAJOR < 57)
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* AVCODEC_VERSION_H */
|
#endif /* AVCODEC_VERSION_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user