Frank Plowman
2b3609ab61
avcodec/vvc: Skip over the current picture in find_ref_idx
...
In VVC, there are two schemes for addressing reference pictures in
the DPB:
1. Normally, the POC of the reference picture is signaled using a delta
from the current picture POC.
2. In the case of long-term reference pictures (LTRPs), which may be far
away from the current POC, the absolute value of the LTRP POC is
signalled. This scheme has two sub-schemes:
a. Signalling the entirety of the absolute value of the LTRP
POC would be expensive, so in most cases we only signal the
sps_log2_max_pic_order_cnt_lsb_minus4 + 4 least-significant bits
of the LTRP POC.
b. In the case of a collision in the least-significant bits,
the full POC is signalled.
Both schemes are implemented in find_ref_idx. The use_msb parameter
of find_ref_idx is nonzero in the case of schemes 1 and 2b, and zero in
the case of scheme 2a.
This commit fixes a bug in scheme 2a. The issue arises from the fact
that the current picture is stored in the DPB at the time find_ref_idx
is invoked in FFmpeg's implementation, whereas in the specification the
current picture is not yet considered part of the DPB. The current
picture may have a POC which shares least-significant bits with an LTRP.
The specification does not identify this as a collision however (see the
condition in 7.4.10, under the semantics of
delta_poc_msb_cycle_present_flag), and so scheme 2a is used rather than
scheme 2b. If the current frame precedes the correct LTRP in the DPB,
FFmpeg's implementation then interprets the signalling to mean a frame
which references itself. The problematic callsite identifies this as an
issue and returns an AVERROR_INVALIDDATA, but this scenario can occur in
valid bitstreams. For example, the conformance bitstream
LTRP_A_ERICSSON_3 has one such instance. FFmpeg gets away with decoding
it currently because the LTRP precedes the current picture in the DPB,
but this is by chance rather than design.
The commit addresses this issue by skipping over the current picture
inside the main loop of find_ref_idx. An unambiguous reference to the
current picture is still syntactically possible but illegal when using
scheme 2b. The handling of this case is moved from find_ref_idx to the
caller, which allows for simplifying find_ref_idx.
Signed-off-by: Frank Plowman <post@frankplowman.com >
2026-09-13 10:37:40 +01:00
..
2026-06-17 17:34:24 +09:00
2026-09-02 22:31:34 +02:00
2026-09-08 03:00:16 +02:00
2026-09-10 18:23:50 +00:00
2026-09-08 03:17:20 +00:00
2026-08-13 00:29:25 +02:00
2026-09-02 22:31:34 +02:00
2026-09-12 23:52:20 +00:00
2026-08-19 22:25:07 +02:00
2026-09-11 15:59:03 +00:00
2026-09-12 23:52:20 +00:00
2026-08-18 13:58:14 +09:00
2026-09-13 10:37:40 +01:00
2026-09-12 17:41:18 -07:00
2026-07-19 20:41:52 +08:00
2026-07-01 21:05:27 +09:00
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
2026-08-31 19:22:59 +02:00
2026-07-01 21:05:27 +09:00
2026-07-01 21:05:27 +09:00
2026-08-31 19:22:59 +02:00
2026-09-12 23:52:20 +00:00
2026-07-19 23:50:55 +08:00
2026-09-12 23:52:20 +00:00
2026-04-17 16:46:52 +02:00
2026-09-12 23:52:20 +00:00
2026-04-17 16:46:52 +02:00
2026-09-09 18:06:23 +00:00
2026-09-12 23:52:20 +00:00
2026-08-10 22:01:35 +00:00
2026-08-19 15:29:46 +00:00
2026-08-19 15:29:46 +00:00
2026-09-09 18:06:23 +00:00
2026-09-02 22:31:34 +02:00
2026-07-02 17:53:20 -03:00
2026-07-02 17:53:20 -03:00
2026-08-26 15:53:44 +00:00
2026-09-09 18:06:23 +00:00
2026-08-26 15:53:44 +00:00
2026-06-07 02:57:25 +00:00
2026-06-11 14:06:20 +00:00
2026-07-02 14:38:46 +00:00
2026-06-12 00:47:12 +00:00
2026-09-06 00:48:26 +02:00
2026-05-03 14:54:27 +00:00
2026-06-19 09:48:56 +00:00
2026-03-31 14:07:31 +00:00
2026-04-07 14:54:21 +00:00
2026-06-19 08:44:30 +00:00
2026-06-19 08:44:30 +00:00
2026-03-30 13:23:56 +00:00
2026-03-11 10:23:35 +01:00
2026-04-28 12:29:37 +00:00
2026-03-13 04:39:52 +01:00
2026-09-12 03:36:22 +00:00
2026-07-11 11:10:12 -03:00
2026-07-11 17:10:50 +09:00
2026-05-19 17:43:53 +09:00
2026-03-14 19:31:45 +01:00
2026-08-17 14:57:07 +09:00
2026-04-28 12:29:37 +00:00
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
2026-05-25 03:18:53 +00:00
2026-04-25 22:44:39 +02:00
2026-05-06 15:27:21 +02:00
2026-07-11 11:10:12 -03:00
2026-07-11 11:10:12 -03:00
2026-08-21 03:35:19 +00:00
2026-08-21 03:35:19 +00:00
2026-07-28 08:39:15 +00:00
2026-06-23 19:15:57 +02:00
2026-09-11 15:59:03 +00:00
2026-06-23 19:15:57 +02:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-09-10 18:23:50 +00:00
2026-07-07 19:04:42 +00:00
2026-08-13 20:46:10 +00:00
2026-07-06 13:26:02 -03:00
2026-07-06 13:26:02 -03:00
2026-07-06 13:26:02 -03:00
2026-07-06 13:26:02 -03:00
2026-03-15 19:27:07 -03:00
2026-04-28 12:29:37 +00:00
2026-08-11 20:20:16 +02:00
2026-08-11 20:20:16 +02:00
2026-08-11 20:20:16 +02:00
2026-08-11 20:20:16 +02:00
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
2026-07-02 16:45:04 +09:00
2026-07-28 18:04:35 +00:00
2026-06-20 21:19:56 -03:00
2026-05-08 09:35:38 +02:00
2026-05-08 09:35:38 +02:00
2026-06-12 00:43:44 +00:00
2026-06-12 00:43:44 +00:00
2026-06-12 00:43:44 +00:00
2026-09-06 20:55:01 +00:00
2026-09-06 20:55:01 +00:00
2026-03-15 19:20:06 -03:00
2026-03-15 19:20:06 -03:00
2026-08-09 15:01:31 -03:00
2026-04-28 12:24:54 +00:00
2026-05-08 09:35:38 +02:00
2026-05-08 09:35:38 +02:00
2026-07-31 13:18:57 +00:00
2026-07-28 17:54:07 +02:00
2026-03-07 19:21:38 -03:00
2026-07-28 17:54:07 +02:00
2026-08-14 18:28:09 +02:00
2026-06-16 10:11:32 -03:00
2026-04-28 14:31:19 +02:00
2026-08-14 10:31:57 -03:00
2026-05-30 13:57:13 +00:00
2026-06-03 20:35:41 +00:00
2026-08-19 22:35:29 +00:00
2026-09-05 11:59:49 +00:00
2026-09-05 11:59:49 +00:00
2026-09-05 11:59:49 +00:00
2026-08-21 08:25:47 +00:00
2026-06-13 11:21:14 +00:00
2026-06-13 11:21:14 +00:00
2026-08-21 08:25:47 +00:00
2026-08-21 08:25:47 +00:00
2026-09-05 11:59:49 +00:00
2026-09-05 11:59:49 +00:00
2026-09-05 11:59:49 +00:00
2026-09-05 11:59:49 +00:00
2026-09-05 11:59:49 +00:00
2026-07-11 19:32:17 -03:00
2026-04-28 12:29:37 +00:00
2026-07-11 19:32:17 -03:00
2026-07-11 19:32:17 -03:00
2026-07-11 19:32:17 -03:00
2026-04-27 20:13:23 +00:00
2026-04-27 20:13:23 +00:00
2026-09-12 23:52:20 +00:00
2026-07-15 01:36:36 +00:00
2026-06-05 03:02:04 +00:00
2026-05-03 16:56:43 +02:00
2026-07-22 14:52:57 +02:00
2026-08-09 17:29:55 +02:00
2026-08-09 17:29:55 +02:00
2026-08-09 17:29:55 +02:00
2026-08-09 17:26:53 +02:00
2026-08-09 17:26:51 +02:00
2026-08-09 17:26:51 +02:00
2026-08-06 15:19:52 +00:00
2026-09-10 13:08:54 +02:00
2026-07-31 04:00:56 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-09-06 00:48:26 +02:00
2026-09-06 00:48:26 +02:00
2026-09-06 00:48:26 +02:00
2026-09-06 00:48:26 +02:00
2026-09-06 00:48:26 +02:00
2026-03-10 13:52:18 +01:00
2026-04-28 12:29:37 +00:00
2026-07-29 21:07:17 +00:00
2026-03-22 00:33:26 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-06-24 13:49:42 -07:00
2026-07-28 08:39:15 +00:00
2026-07-02 17:53:20 -03:00
2026-04-28 12:29:37 +00:00
2026-08-14 10:31:57 -03:00
2026-08-14 18:28:09 +02:00
2026-04-09 01:14:39 +02:00
2026-06-23 19:15:57 +02:00
2026-08-28 18:50:16 +00:00
2026-06-05 03:02:04 +00:00
2026-07-13 00:57:26 +00:00
2026-09-12 23:52:20 +00:00
2026-06-06 21:32:08 +00:00
2026-09-11 15:59:03 +00:00
2026-09-11 15:59:03 +00:00
2026-09-08 23:59:36 +00:00
2026-05-31 20:04:02 +09:00
2026-06-03 14:12:50 +09:00
2026-08-02 22:11:27 +09:00
2026-05-31 20:03:57 +09:00
2026-05-31 20:03:57 +09:00
2026-03-20 15:50:09 +00:00
2026-07-31 19:37:52 +00:00
2026-08-17 14:57:07 +09:00
2026-06-28 00:22:09 +00:00
2026-04-28 12:29:37 +00:00
2026-05-17 17:49:59 +00:00
2026-04-08 21:33:43 +02:00
2026-04-28 12:29:37 +00:00
2026-03-10 13:52:19 +01:00
2026-07-23 10:39:47 -03:00
2026-03-07 20:14:36 +01:00
2026-08-11 21:16:28 +02:00
2026-07-14 19:45:02 +00:00
2026-08-11 21:16:28 +02:00
2026-08-11 21:16:28 +02:00
2026-08-31 18:13:21 +00:00
2026-08-26 00:41:35 +00:00
2026-08-13 00:29:25 +02:00
2026-08-13 00:29:25 +02:00
2026-08-31 18:13:21 +00:00
2026-08-31 18:13:21 +00:00
2026-07-16 07:19:35 +00:00
2026-06-07 18:55:16 +00:00
2026-05-03 12:42:47 +00:00
2026-06-02 19:50:39 -03:00
2026-09-05 01:38:48 +00:00
2026-08-13 00:29:25 +02:00
2026-04-16 07:36:01 +02:00
2026-04-16 07:36:01 +02:00
2026-04-16 07:36:01 +02:00
2026-09-05 01:38:48 +00:00
2026-09-05 01:38:48 +00:00
2026-08-13 00:29:25 +02:00
2026-08-13 00:29:25 +02:00
2026-08-13 00:29:25 +02:00
2026-07-05 17:47:56 +00:00
2026-07-05 17:47:56 +00:00
2026-08-16 18:35:04 +02:00
2026-08-16 18:35:04 +02:00
2026-03-15 19:20:06 -03:00
2026-03-15 19:20:06 -03:00
2026-06-23 19:15:57 +02:00
2026-06-02 19:50:39 -03:00
2026-06-07 18:55:16 +00:00
2026-05-13 19:35:33 +00:00
2026-03-10 13:52:19 +01:00
2026-07-05 09:02:40 +02:00
2026-08-12 20:05:32 +02:00
2026-08-12 20:05:32 +02:00
2026-08-02 02:19:05 +02:00
2026-08-02 02:19:05 +02:00
2026-08-12 20:05:32 +02:00
2026-08-17 14:57:07 +09:00
2026-08-21 08:25:47 +00:00
2026-07-14 19:45:02 +00:00
2026-07-14 19:45:02 +00:00
2026-06-03 20:35:41 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-08-02 16:06:47 +00:00
2026-06-23 19:15:57 +02:00
2026-06-02 19:50:39 -03:00
2026-08-31 10:56:08 +00:00
2026-07-07 17:31:26 +00:00
2026-03-27 13:56:00 +00:00
2026-06-13 21:40:40 +00:00
2026-09-12 23:52:20 +00:00
2026-04-28 12:29:37 +00:00
2026-03-09 18:39:33 -03:00
2026-07-02 18:24:32 +02:00
2026-04-06 14:07:59 -03:00
2026-09-07 12:52:48 -03:00
2026-08-19 09:25:40 -03:00
2026-04-06 14:07:59 -03:00
2026-04-06 14:07:59 -03:00
2026-08-12 02:50:23 +00:00
2026-05-03 12:40:44 +00:00
2026-06-02 19:50:39 -03:00
2026-08-14 10:31:57 -03:00
2026-07-13 01:08:03 +00:00
2026-08-17 14:49:03 -03:00
2026-08-26 12:28:53 -03:00
2026-08-24 22:02:56 -03:00
2026-09-12 23:52:20 +00:00
2026-07-11 11:10:12 -03:00
2026-06-19 15:18:54 +02:00
2026-07-11 11:10:12 -03:00
2026-08-03 11:08:57 +00:00
2026-07-11 11:10:12 -03:00
2026-07-11 11:10:12 -03:00
2026-07-11 11:10:12 -03:00
2026-04-28 12:29:37 +00:00
2026-07-11 11:10:12 -03:00
2026-06-23 19:15:57 +02:00
2026-08-14 10:31:57 -03:00
2026-06-23 19:15:57 +02:00
2026-05-03 18:23:00 +02:00
2026-09-11 13:22:28 -03:00
2026-05-03 18:23:03 +02:00
2026-05-03 18:23:05 +02:00
2026-07-01 21:05:22 +09:00
2026-07-01 21:05:22 +09:00
2026-07-07 17:35:58 +00:00
2026-07-07 17:35:58 +00:00
2026-07-03 01:55:02 +00:00
2026-05-25 02:05:30 +00:00
2026-09-09 18:06:23 +00:00
2026-08-30 03:23:09 +00:00
2026-09-08 23:17:55 +00:00
2026-09-09 11:29:23 +08:00
2026-07-20 02:35:53 +00:00
2026-08-30 03:23:09 +00:00
2026-04-22 10:48:24 +03:00
2026-07-05 09:02:40 +02:00
2026-06-13 15:55:40 +00:00
2026-07-11 02:09:25 +00:00
2026-07-11 02:09:25 +00:00
2026-03-07 20:14:36 +01:00
2026-07-11 11:10:12 -03:00
2026-03-10 13:52:19 +01:00
2026-06-16 09:18:23 -03:00
2026-06-16 09:18:23 -03:00
2026-07-14 19:45:02 +00:00
2026-08-11 21:17:13 +02:00
2026-08-11 21:17:13 +02:00
2026-07-14 19:45:02 +00:00
2026-03-07 20:14:36 +01:00
2026-03-07 20:14:36 +01:00
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
2026-03-10 13:52:18 +01:00
2026-04-16 07:36:01 +02:00
2026-05-03 18:22:31 +02:00
2026-05-03 18:22:27 +02:00
2026-04-06 10:39:17 +02:00
2026-04-06 10:39:17 +02:00
2026-07-22 14:52:57 +02:00
2026-06-05 01:27:39 +00:00
2026-06-26 21:14:51 +00:00
2026-07-11 11:10:12 -03:00
2026-05-02 21:39:02 +00:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-07-16 15:02:09 +02:00
2026-06-24 18:51:12 +00:00
2026-06-24 18:51:12 +00:00
2026-06-24 18:51:12 +00:00
2026-08-02 16:06:47 +00:00
2026-07-14 19:45:02 +00:00
2026-06-10 02:15:53 +00:00
2026-09-11 15:59:03 +00:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:15:57 +02:00
2026-06-23 19:15:57 +02:00
2026-04-28 12:29:37 +00:00
2026-06-23 17:15:02 +02:00
2026-06-23 17:15:02 +02:00
2026-06-23 17:15:02 +02:00
2026-07-28 17:39:23 +02:00
2026-07-28 17:54:07 +02:00
2026-07-28 17:39:23 +02:00
2026-05-16 13:55:22 -03:00
2026-05-03 10:25:54 +00:00
2026-04-20 12:54:31 +02:00
2026-07-31 13:34:50 +00:00
2026-05-25 15:09:20 +00:00
2026-09-12 23:52:20 +00:00
2026-07-05 09:02:40 +02:00
2026-03-06 02:33:59 +01:00
2026-05-17 12:17:16 +09:00
2026-06-10 02:38:36 +09:00
2026-05-17 12:02:52 +09:00
2026-09-10 17:16:20 +00:00
2026-05-17 12:17:16 +09:00
2026-05-17 12:17:16 +09:00
2026-08-17 14:57:07 +09:00
2026-04-28 12:29:37 +00:00
2026-07-01 21:05:27 +09:00
2026-07-19 20:41:48 +08:00
2026-09-05 01:38:48 +00:00
2026-08-14 10:41:40 +02:00
2026-08-09 17:29:30 +02:00
2026-08-09 17:29:30 +02:00
2026-03-28 22:07:54 -03:00
2026-06-02 20:51:32 +00:00
2026-07-11 11:10:12 -03:00
2026-05-03 13:25:30 +00:00
2026-06-28 21:52:21 +00:00
2026-03-10 13:52:19 +01:00
2026-04-28 12:29:37 +00:00
2026-07-29 21:20:49 +00:00
2026-06-13 15:54:44 +00:00
2026-03-07 20:14:36 +01:00
2026-03-07 20:14:36 +01:00
2026-03-07 20:14:36 +01:00
2026-09-12 03:20:09 +00:00
2026-03-18 18:05:20 +01:00
2026-05-16 13:55:22 -03:00
2026-06-13 22:03:59 +00:00
2026-03-28 11:25:38 +01:00
2026-03-28 11:25:38 +01:00
2026-03-28 11:25:38 +01:00
2026-03-28 11:25:38 +01:00
2026-03-28 11:25:38 +01:00
2026-04-17 16:46:52 +02:00
2026-08-10 19:52:20 +02:00
2026-07-27 03:33:28 +00:00
2026-05-03 18:22:24 +02:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-09-12 23:52:20 +00:00
2026-09-12 23:52:20 +00:00
2026-04-13 12:51:35 +02:00
2026-04-13 12:51:35 +02:00
2026-08-16 18:35:04 +02:00
2026-04-13 12:46:24 +02:00
2026-04-13 12:46:24 +02:00
2026-09-12 23:52:20 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-08-13 13:17:59 +02:00
2026-09-07 03:57:59 +00:00
2026-09-07 03:57:59 +00:00
2026-04-28 12:29:37 +00:00
2026-07-13 16:13:04 +00:00
2026-09-12 23:52:20 +00:00
2026-07-30 00:12:22 +00:00
2026-08-28 18:50:16 +00:00
2026-06-11 13:58:45 +00:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:22:44 +02:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
2026-08-09 17:25:23 +02:00
2026-04-28 12:29:37 +00:00
2026-08-02 16:06:47 +00:00
2026-03-10 13:52:18 +01:00
2026-04-28 12:29:37 +00:00
2026-06-23 19:15:57 +02:00
2026-08-10 20:22:42 +02:00
2026-08-21 08:25:47 +00:00
2026-08-21 08:25:47 +00:00
2026-08-21 08:25:47 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-04-28 12:29:37 +00:00
2026-08-22 17:48:39 +00:00
2026-04-28 12:29:37 +00:00
2026-07-14 19:45:02 +00:00
2026-08-01 16:50:06 +02:00
2026-06-06 19:07:39 +00:00
2026-04-28 12:29:37 +00:00
2026-05-03 18:22:07 +02:00
2026-04-28 12:29:37 +00:00
2026-09-06 00:48:26 +02:00
2026-07-28 17:54:07 +02:00
2026-09-11 15:59:03 +00:00
2026-03-19 14:44:40 +01:00
2026-03-19 14:44:40 +01:00
2026-03-19 14:44:40 +01:00
2026-04-12 22:15:51 +00:00
2026-05-17 03:47:23 +00:00
2026-09-10 02:45:44 +00:00
2026-04-28 12:29:37 +00:00
2026-05-30 13:10:07 +02:00
2026-05-30 13:10:07 +02:00
2026-07-13 00:58:16 +00:00
2026-09-12 05:25:45 +02:00
2026-06-14 22:04:42 +02:00
2026-03-10 13:52:19 +01:00
2026-09-12 03:20:09 +00:00
2026-07-30 06:51:57 +00:00
2026-09-12 03:20:09 +00:00
2026-07-30 06:51:57 +00:00
2026-08-17 14:57:07 +09:00
2026-08-28 13:01:39 +00:00
2026-08-28 13:01:39 +00:00
2026-08-17 14:57:07 +09:00
2026-08-17 14:57:07 +09:00
2026-08-02 22:11:28 +09:00
2026-08-15 18:02:17 +09:00
2026-08-17 06:48:49 +00:00
2026-08-17 06:48:49 +00:00
2026-08-05 16:04:37 +09:00
2026-08-17 14:57:07 +09:00
2026-08-15 18:34:14 +09:00
2026-08-15 18:34:14 +09:00
2026-08-17 14:57:07 +09:00
2026-08-17 14:57:07 +09:00
2026-08-17 14:57:07 +09:00
2026-08-17 14:57:07 +09:00
2026-08-05 16:04:37 +09:00
2026-05-09 11:44:39 -03:00
2026-09-06 00:48:26 +02:00
2026-08-31 13:42:52 +00:00
2026-06-23 19:15:57 +02:00
2026-06-19 04:33:18 +00:00
2026-04-28 12:29:37 +00:00
2026-05-03 02:36:54 +00:00
2026-03-13 23:22:54 +01:00
2026-03-16 10:24:33 +00:00
2026-05-03 13:22:37 +00:00