Repository navigation
svac3: pictures of several patches - #7
Conversation
A picture of several uniform patches is decoded one patch at a time: svac3_picture_begin(), svac3_picture_patch() per patch in order, then svac3_picture_end(), which runs deblocking and SAO over the whole picture (cross_patch_loop_filter_enable_flag) and stores its temporal motion. Each patch restarts the entropy decoder and its contexts and starts from its own QP; a neighbour in another patch is unavailable, for prediction, contexts and SAO merge alike. svac3_dec gathers a picture's patches and outputs it after the last one. A picture that loses a patch is dropped: the patch out of order, or the picture header or next first patch that ends it, returns SVAC3_ERR_CORRUPT. Two new streams from the Hi3516CV608 encoder with its slice split on, 9 and 12 patches per picture, are bit-exact against the reference decoder, through libsvac3d and through FFmpeg.
PR Summary by QodoDecode SVAC3 pictures spanning multiple uniform patches
AI Description
Diagram
High-Level Assessment
Files changed (14)
|
Code Review by Qodo
1.
|
…t errors decode_patch() resets NumDeltaQp and the QP group origin at each patch, as it already reset the QPs and contexts. svac3d_decode() no longer stops at the first NAL unit in error: the unit that reveals a lost patch is itself decoded and may complete a picture, so every completed picture is given out and the first error is returned at the end. test_api -lost checks it on a stream missing one patch.
|
Thanks, both valid; both fixed in the latest commit. 1. Later patches misdecode with small LCUs: fixed. 2. One lost patch also drops the next picture: fixed at the API.
New test: ctest: 24/24 in release, and the new and changed tests are clean under ASan+UBSan. |
Decodes pictures cut into several patches, the last single-patch restriction on what the Hi3516CV608 encoder emits. Its slice split cuts every N LCU rows.
Patch decoder: a picture is now decoded one patch at a time:
svac3_picture_begin()svac3_picture_patch()patch_indexorder; returns 1 at the last onesvac3_picture_end()What each patch does:
patch_width_minus1/patch_height_minus1.patch_qpandfixed_patch_qp_flag.svac3_patch_decode()/svac3_patch_parse()stay for single-patch pictures and single patches. Pictures whose loop filters stop at patch boundaries (cross_patch_loop_filter_enable_flag0 with several patches) are refused: there is no stream to check them against.Picture decoder:
svac3_decnow keeps a picture open across its patch NAL units and outputs it after the last one. A picture that loses a patch is dropped, and the unit that reveals the loss returnsSVAC3_ERR_CORRUPT. That unit is one of:Corpus. Two new streams with the encoder's slice split on. Both are bit-exact against the reference decoder through
svac3decand through FFmpeg:cv608_patch4_1080pcv608_patch2_720pAll earlier streams are unchanged, and the local 2560x1440 one is still 295/295.
Tests:
test_dec -patches, oncv608_patch4_1080p:CORRUPTand outputs nothing;CORRUPT.test_patchcovers:patch_indexpast the picture;patch_width_minus1no longer divides by zero, and the reference count is not computed before it is validated (UBSan).