1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-11-23 21:54:53 +02:00

avcodec/hevc: add ff_hevc_compute_poc2 which don't depend on HEVCSPS directly

So it can be used in other places like bsf.
This commit is contained in:
Zhao Zhili
2025-10-13 20:15:53 +08:00
committed by Zhao Zhili
parent 5f15734d92
commit 6c83bcadbb
2 changed files with 8 additions and 3 deletions

View File

@@ -2443,9 +2443,9 @@ void ff_hevc_ps_uninit(HEVCParamSets *ps)
av_refstruct_unref(&ps->pps_list[i]); av_refstruct_unref(&ps->pps_list[i]);
} }
int ff_hevc_compute_poc(const HEVCSPS *sps, int pocTid0, int poc_lsb, int nal_unit_type) int ff_hevc_compute_poc2(unsigned log2_max_poc_lsb, int pocTid0, int poc_lsb, int nal_unit_type)
{ {
int max_poc_lsb = 1 << sps->log2_max_poc_lsb; int max_poc_lsb = 1 << log2_max_poc_lsb;
int prev_poc_lsb = pocTid0 % max_poc_lsb; int prev_poc_lsb = pocTid0 % max_poc_lsb;
int prev_poc_msb = pocTid0 - prev_poc_lsb; int prev_poc_msb = pocTid0 - prev_poc_lsb;
int poc_msb; int poc_msb;

View File

@@ -546,6 +546,11 @@ int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
/** /**
* Compute POC of the current frame and return it. * Compute POC of the current frame and return it.
*/ */
int ff_hevc_compute_poc(const HEVCSPS *sps, int pocTid0, int poc_lsb, int nal_unit_type); int ff_hevc_compute_poc2(unsigned log2_max_poc_lsb, int pocTid0, int poc_lsb, int nal_unit_type);
static inline int ff_hevc_compute_poc(const HEVCSPS *sps, int pocTid0, int poc_lsb, int nal_unit_type)
{
return ff_hevc_compute_poc2(sps->log2_max_poc_lsb, pocTid0, poc_lsb, nal_unit_type);
}
#endif /* AVCODEC_HEVC_PS_H */ #endif /* AVCODEC_HEVC_PS_H */