Skip to content

Commit

Permalink
libavcenc: Sync default values of library and application
Browse files Browse the repository at this point in the history
I and IDR interval default values do not comply with requirements
of the codec. This is fixed. Also corrected few other default values.
  • Loading branch information
ram-mohan authored and harishdm committed Oct 4, 2023
1 parent f9f0475 commit a7b6206
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions encoder/ih264e_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2905,9 +2905,9 @@ static WORD32 ih264e_set_default_params(cfg_params_t *ps_cfg)
ps_cfg->e_cmd = IVE_CMD_CT_NA;
ps_cfg->i4_wd_mbs = ps_cfg->u4_max_wd >> 4;
ps_cfg->i4_ht_mbs = ps_cfg->u4_max_ht >> 4;
ps_cfg->u4_entropy_coding_mode = CAVLC;
ps_cfg->u4_entropy_coding_mode = DEFAULT_ENTROPY_CODING_MODE;
ps_cfg->u4_weighted_prediction = 0;
ps_cfg->u4_constrained_intra_pred = 0;
ps_cfg->u4_constrained_intra_pred = DEFAULT_CONSTRAINED_INTRAPRED;
ps_cfg->u4_pic_info_type = 0;
ps_cfg->u4_mb_info_type = 0;
ps_cfg->s_vui.u1_video_signal_type_present_flag = 0;
Expand Down
23 changes: 11 additions & 12 deletions encoder/ih264e_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,14 @@
#define DEFAULT_RECON_ENABLE 0
#define DEFAULT_QUALITY_METRICS_ENABLE 0
#define DEFAULT_RC IVE_RC_STORAGE
#define DEFAULT_MAX_FRAMERATE 120000
#define DEFAULT_MAX_FRAMERATE 120000 /* in ticks (1000 ticks = 1s) */
#define DEFAULT_MAX_BITRATE 240000000
#define DEFAULT_MAX_NUM_BFRAMES 0
#define DEFAULT_MAX_SRCH_RANGE_X 256
#define DEFAULT_MAX_SRCH_RANGE_Y 256
#define DEFAULT_SLICE_PARAM 256
#define DEFAULT_SRC_FRAME_RATE 30000
#define DEFAULT_TGT_FRAME_RATE 30000
#define DEFAULT_SRC_FRAME_RATE 30000 /* in ticks (1000 ticks = 1s) */
#define DEFAULT_TGT_FRAME_RATE 30000 /* in ticks (1000 ticks = 1s) */
#define DEFAULT_BITRATE 6000000
#define DEFAULT_QP_MIN 10
#define DEFAULT_QP_MAX 51
Expand All @@ -274,21 +274,20 @@
#define DEFAULT_MIN_SAD_ENABLE 0
#define DEFAULT_MIN_SAD_DISABLE -1
#define DEFAULT_SRCH_RNG_X 64
#define DEFAULT_SRCH_RNG_Y 48
#define DEFAULT_SRCH_RNG_Y 64
#define DEFAULT_I_INTERVAL 30
#define DEFAULT_IDR_INTERVAL 1000
#define DEFAULT_B_FRAMES 0
#define DEFAULT_IDR_INTERVAL 1200
#define DEFAULT_DISABLE_DEBLK_LEVEL 0
#define DEFAULT_PROFILE IV_PROFILE_BASE
#define DEFAULT_MIN_INTRA_FRAME_RATE 1
#define DEFAULT_MAX_INTRA_FRAME_RATE 2147483647
#define DEFAULT_MIN_BUFFER_DELAY 30
#define DEFAULT_MAX_BUFFER_DELAY 20000
#define DEFAULT_STRIDE 0
#define DEFAULT_ENC_SPEED_PRESET IVE_USER_DEFINED
#define DEFAULT_PRE_ENC_ME 0
#define DEFAULT_PRE_ENC_IPE 0
#define DEFAULT_ENTROPY_CODING_MODE 0
#define DEFAULT_CONSTRAINED_INTRAPRED 0

/** Maximum number of entries in input buffer list */
#define MAX_INP_BUF_LIST_ENTRIES 32
Expand Down Expand Up @@ -374,15 +373,15 @@
/* [0 - 00 - 00110] */
#define NAL_SEI_FIRST_BYTE 0x06

#define H264_ALLOC_INTER_FRM_INTV 2

/**
******************************************************************************
* @brief h264qp and linear qp map
******************************************************************************
*/
#define H264_MPEG_QP_MAP 255

#define MPEG2_QP_ELEM (H264_MPEG_QP_MAP + 1)
#define H264_QP_ELEM (MAX_H264_QP + 1)

#define H264_INIT_QUANT_I 26
#define H264_INIT_QUANT_P 34

/*****************************************************************************/
/* Enums */
Expand Down
6 changes: 3 additions & 3 deletions examples/avcenc/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
#define DEFAULT_RECON_COLOR_FMT IV_YUV_420P
#define DEFAULT_NUM_CORES 1
#define DEFAULT_LOOPBACK 0
#define DEFAULT_MAX_FRAMERATE 120
#define DEFAULT_MAX_FRAMERATE 120000 /* in ticks (1000 ticks = 1s) */
#define DEFAULT_SRC_FRAME_RATE 30
#define DEFAULT_TGT_FRAME_RATE 30
#define DEFAULT_MAX_WD 1920
Expand All @@ -110,8 +110,8 @@
#define DEFAULT_B_QP_MIN DEFAULT_QP_MIN
#define DEFAULT_AIR 0
#define DEFAULT_AIR_REFRESH_PERIOD 30
#define DEFAULT_SRCH_RNG_X 16
#define DEFAULT_SRCH_RNG_Y 16
#define DEFAULT_SRCH_RNG_X 64
#define DEFAULT_SRCH_RNG_Y 64
#define DEFAULT_I_INTERVAL 30
#define DEFAULT_IDR_INTERVAL 1200
#define DEFAULT_CONSTRAINED_INTRAPRED 0
Expand Down

0 comments on commit a7b6206

Please sign in to comment.