mirror of
				https://github.com/nyanmisaka/ffmpeg-rockchip.git
				synced 2025-10-31 20:42:49 +08:00 
			
		
		
		
	avcodec/avs3_parser: set has_b_frames properly
has_b_frames should be output_reorder_delay field in AVS3 sequence header and larger than 1. The parser implementation doesn't parse that field. Decoder can set has_b_frames properly, so use FFMAX here to avoid resetting has_b_frames from output_reorder_delay to 1. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
		| @@ -71,7 +71,7 @@ static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf, | |||||||
|     if (buf[0] == 0x0 && buf[1] == 0x0 && buf[2] == 0x1) { |     if (buf[0] == 0x0 && buf[1] == 0x0 && buf[2] == 0x1) { | ||||||
|         if (buf[3] == AVS3_SEQ_START_CODE) { |         if (buf[3] == AVS3_SEQ_START_CODE) { | ||||||
|             GetBitContext gb; |             GetBitContext gb; | ||||||
|             int profile, ratecode; |             int profile, ratecode, low_delay; | ||||||
|  |  | ||||||
|             init_get_bits8(&gb, buf + 4, buf_size - 4); |             init_get_bits8(&gb, buf + 4, buf_size - 4); | ||||||
|  |  | ||||||
| @@ -114,7 +114,8 @@ static void parse_avs3_nal_units(AVCodecParserContext *s, const uint8_t *buf, | |||||||
|             //            bitrate_high(12) |             //            bitrate_high(12) | ||||||
|             skip_bits(&gb, 32); |             skip_bits(&gb, 32); | ||||||
|  |  | ||||||
|             avctx->has_b_frames = !get_bits(&gb, 1); |             low_delay = get_bits(&gb, 1); | ||||||
|  |             avctx->has_b_frames = FFMAX(avctx->has_b_frames, !low_delay); | ||||||
|  |  | ||||||
|             avctx->framerate.num = avctx->time_base.den = ff_avs3_frame_rate_tab[ratecode].num; |             avctx->framerate.num = avctx->time_base.den = ff_avs3_frame_rate_tab[ratecode].num; | ||||||
|             avctx->framerate.den = avctx->time_base.num = ff_avs3_frame_rate_tab[ratecode].den; |             avctx->framerate.den = avctx->time_base.num = ff_avs3_frame_rate_tab[ratecode].den; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zhao Zhili
					Zhao Zhili