[FFmpeg-cvslog] avcodec/cbs_h266: fix logic setting num_layers_in_ols when vps_ols_mode_idc is 2

James Almer git at videolan.org
Mon Feb 26 02:06:32 EET 2024


ffmpeg | branch: release/6.1 | James Almer <jamrial at gmail.com> | Mon Jan 29 20:41:34 2024 -0300| [d6399d50aee3bb444fd823e5eba48f5a32827acc] | committer: James Almer

avcodec/cbs_h266: fix logic setting num_layers_in_ols when vps_ols_mode_idc is 2

The old code did not follow the syntax from the spec.

Reviewed-by: Frank Plowman <post at frankplowman.com>
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 66f028accbcc88d56716065f7a40a681a798064a)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d6399d50aee3bb444fd823e5eba48f5a32827acc
---

 libavcodec/cbs_h266_syntax_template.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libavcodec/cbs_h266_syntax_template.c b/libavcodec/cbs_h266_syntax_template.c
index 5a34200a18..a4c1363ba6 100644
--- a/libavcodec/cbs_h266_syntax_template.c
+++ b/libavcodec/cbs_h266_syntax_template.c
@@ -902,11 +902,10 @@ static int FUNC(vps) (CodedBitstreamContext *ctx, RWContext *rw,
                        current->vps_ols_mode_idc == 1) {
                 num_layers_in_ols = i + 1;
             } else if (current->vps_ols_mode_idc == 2) {
-                for (k = 0, j = 0; k <= current->vps_max_layers_minus1; k++) {
+                for (k = 0, j = 0; k <= current->vps_max_layers_minus1; k++)
                     if (layer_included_in_ols_flag[i][k])
                         j++;
-                    num_layers_in_ols = j;
-                }
+                num_layers_in_ols = j;
             }
             if (num_layers_in_ols > 1) {
                 num_multi_layer_olss++;



More information about the ffmpeg-cvslog mailing list