Recently, in a VoIP-related project, the upper computer directly uses Linphone for secondary development. The lower computer uses the SIP client developed using Osip and FFMPEG. The following warning message is printed during FFMPEG decoding during testing:
Too export slices (17> = 16), increase max_slices and recompil too export slices (18> = 16), increase max_slices and recompil too export slices (20> = 16 ), increase max_slices and recompil...
RelatedCodeIn h264.c
... H0-> last_slice_type = slice_type; H-> slice_num = ++ H0-> current_slice; If (H-> slice_num> = max_slices) {av_log (S-> avctx, av_log_error, "Too export slices (% d >=% D), increase max_slices and recompile \ n", H-> slice_num, max_slices );}...
Obviously, the number of slice instances exceeds the defined maximum value, which is defined by max_slices.
/*** The maximum number of slices supported by the decoder. * must be a power of 2 */# define max_slices 16
When I tried to increase the number to 32, the lower computer decoding error occurred and the cause was not found. So I started from the upper computer. There are several slice-related members in the x264_param_t encoding parameter of x264.
/* Slicing parameters */INT I _slice_max_size;/* max size per slice in bytes; includes estimated nal overhead. */INT I _slice_max_mbs;/* max Number of MBS per slice; overrides I _slice_count. */INT I _slice_count;/* Number of slices per frame: Forces rectangular slices. */
This I _slice_count specifies the number of parts. Therefore, in the enc_preprocess function of the msx264.c file, set I _slice_count In the encoding parameter to 15. However, the test showed that this was useless. Later, the problem was found in the x264 source code.
// X264/encoder. c Function x264_validate_parameters... if (H-> param. I _slice_max_mbs | H-> param. I _slice_max_size) H-> param. I _slice_count = 0 ;...
As shown in the preceding code snippet, I _slice_max_mbs and I _slice_max_size values are cleared by 0. The enc_preprocess function of msx264.c has the following statement:
Params. I _slice_max_size = ms_get_payload_max_size ()-100;/*-100 security margin */
Now the truth is clear, directly comment out the above statement, and the test passes.