What version / commit were you testing with?
$ git describe
v1.0.0-70-g7a4706b3c
$ git log -1
commit 7a4706b
Author: Andrey Norkin 40504168+andrey-norkin@users.noreply.github.com
Date: Tue Aug 4 16:08:07 2026 -0700
Fix for timing info rounding due to integer division (#5201)
Also present on main at 1633b4a (v1.0.0-67-g1633b4aff) — the faulty condition is identical at av2/encoder/encode_strategy.c:1025 in both.
What steps will reproduce the problem?
- Build in Release: cmake -B build -S . -GNinja -DCMAKE_BUILD_TYPE=Release && cmake --build build --target avmenc
- Encode any sequence with S-frames and test-decode enabled:
./build/avmenc --verbose --psnr --obu --passes=1 --lag-in-frames=19 --auto-alt-ref=1
--min-gf-interval=16 --max-gf-interval=16 --gf-min-pyr-height=4 --gf-max-pyr-height=4
--kf-min-dist=67 --kf-max-dist=67 --use-fixed-qp-offsets=1 --deltaq-mode=0
--enable-tpl-model=0 --end-usage=q --enable-keyframe-filtering=0 --qp=180
--tile-rows=0 --tile-columns=0 --threads=1 --enable-intrabc-ext=1
--limit=65 --skip=0 --test-decode=1
--enable-sframe=1 --sframe-dist=5 --sframe-mode=0
--cpu-used=6 -o out.obu FourPeople_480x270_60.y4m
- The encode aborts after 6 of the 65 requested frames.
The failure is sequence-independent. --enable-sframe=1 alone is sufficient to trigger it; --sframe-dist and --sframe-mode are not involved in the faulty condition.
Expected behavior
All 65 frames encode, test-decode passes, and the decoder outputs 65 shown frames.
What did you expect to happen?
Actual behavior
The encoder aborts during test decoding:
POC: 0 [ KEY ][Level:1][Q:133] ... 8124 Bytes ... OBU_CLOSED_LOOP_KEY
POC: 16 [ S ][Level:1][Q:148] ... 810 Bytes ... OBU_SWITCH
POC: 8 [INTER][Level:2][Q:164] ... 292 Bytes ... OBU_REGULAR_TILE_GROUP
POC: 4 [INTER][Level:3][Q:172] ... 122 Bytes ... OBU_REGULAR_TILE_GROUP
POC: 2 [INTER][Level:4][Q:177] ... 75 Bytes ... OBU_REGULAR_TILE_GROUP
POC: 1 [INTER][Level:5][Q:180] ... 37 Bytes ... OBU_REGULAR_TILE_GROUP
Failed to get decoder reference frame: Unspecified internal error
No frame ever gets implicit_output_picture = 1, so display order 16 (the S-frame) is never delivered for display. Without --test-decode=1 there is no error, but the affected display orders are silently missing from the output.
Additional information
The suppression in denoise_and_encode() (av2/encoder/encode_strategy.c:1024-1028) is gated on the session-wide cpi->oxcf.kf_cfg.enable_sframe:
if (cm->implicit_output_picture &&
(cpi->oxcf.kf_cfg.enable_sframe ||
cpi->oxcf.tool_cfg.g_error_resilient_mode)) {
cm->implicit_output_picture = 0;
}
Every frame reaching that point is a hidden altref, so immediate_output_picture is 0 and implicit_output_picture is its only route to being output. With add_sef_for_hidden_frames at its default of 0, the matching overlay takes the show_existing_frame path and emits zero bytes, so clearing the flag leaves nothing to output those display orders at all.
The suppression is only needed when the overlay is instead fully coded, which happens only in global error resilient mode, there every inter frame is set to an S-frame, so allow_show_existing() always returns 0. Gating on g_error_resilient_mode alone fixes it; that mode already had enable_sframe 0, so its output is unchanged.
What version / commit were you testing with?
$ git describe
v1.0.0-70-g7a4706b3c
$ git log -1
commit 7a4706b
Author: Andrey Norkin 40504168+andrey-norkin@users.noreply.github.com
Date: Tue Aug 4 16:08:07 2026 -0700
Also present on main at 1633b4a (v1.0.0-67-g1633b4aff) — the faulty condition is identical at av2/encoder/encode_strategy.c:1025 in both.
What steps will reproduce the problem?
./build/avmenc --verbose --psnr --obu --passes=1 --lag-in-frames=19 --auto-alt-ref=1
--min-gf-interval=16 --max-gf-interval=16 --gf-min-pyr-height=4 --gf-max-pyr-height=4
--kf-min-dist=67 --kf-max-dist=67 --use-fixed-qp-offsets=1 --deltaq-mode=0
--enable-tpl-model=0 --end-usage=q --enable-keyframe-filtering=0 --qp=180
--tile-rows=0 --tile-columns=0 --threads=1 --enable-intrabc-ext=1
--limit=65 --skip=0 --test-decode=1
--enable-sframe=1 --sframe-dist=5 --sframe-mode=0
--cpu-used=6 -o out.obu FourPeople_480x270_60.y4m
The failure is sequence-independent. --enable-sframe=1 alone is sufficient to trigger it; --sframe-dist and --sframe-mode are not involved in the faulty condition.
Expected behavior
All 65 frames encode, test-decode passes, and the decoder outputs 65 shown frames.
What did you expect to happen?
Actual behavior
The encoder aborts during test decoding:
POC: 0 [ KEY ][Level:1][Q:133] ... 8124 Bytes ... OBU_CLOSED_LOOP_KEY
POC: 16 [ S ][Level:1][Q:148] ... 810 Bytes ... OBU_SWITCH
POC: 8 [INTER][Level:2][Q:164] ... 292 Bytes ... OBU_REGULAR_TILE_GROUP
POC: 4 [INTER][Level:3][Q:172] ... 122 Bytes ... OBU_REGULAR_TILE_GROUP
POC: 2 [INTER][Level:4][Q:177] ... 75 Bytes ... OBU_REGULAR_TILE_GROUP
POC: 1 [INTER][Level:5][Q:180] ... 37 Bytes ... OBU_REGULAR_TILE_GROUP
Failed to get decoder reference frame: Unspecified internal error
No frame ever gets implicit_output_picture = 1, so display order 16 (the S-frame) is never delivered for display. Without --test-decode=1 there is no error, but the affected display orders are silently missing from the output.
Additional information
The suppression in denoise_and_encode() (av2/encoder/encode_strategy.c:1024-1028) is gated on the session-wide cpi->oxcf.kf_cfg.enable_sframe:
if (cm->implicit_output_picture &&
(cpi->oxcf.kf_cfg.enable_sframe ||
cpi->oxcf.tool_cfg.g_error_resilient_mode)) {
cm->implicit_output_picture = 0;
}
Every frame reaching that point is a hidden altref, so immediate_output_picture is 0 and implicit_output_picture is its only route to being output. With add_sef_for_hidden_frames at its default of 0, the matching overlay takes the show_existing_frame path and emits zero bytes, so clearing the flag leaves nothing to output those display orders at all.
The suppression is only needed when the overlay is instead fully coded, which happens only in global error resilient mode, there every inter frame is set to an S-frame, so allow_show_existing() always returns 0. Gating on g_error_resilient_mode alone fixes it; that mode already had enable_sframe 0, so its output is unchanged.