Skip to content

Support 16 Bits#287

Open
QSXW wants to merge 31 commits intoffvvc:upfrom
QSXW:feat/16bits
Open

Support 16 Bits#287
QSXW wants to merge 31 commits intoffvvc:upfrom
QSXW:feat/16bits

Conversation

@QSXW
Copy link
Collaborator

@QSXW QSXW commented Apr 6, 2025

No description provided.

@QSXW QSXW requested a review from Copilot April 6, 2025 21:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 18 out of 37 changed files in this pull request and generated no comments.

Files not reviewed (19)
  • Changelog: Language not supported
  • configure: Language not supported
  • libavcodec/Makefile: Language not supported
  • libavcodec/bit_depth_template.c: Language not supported
  • libavcodec/cbs_h2645.c: Language not supported
  • libavcodec/cbs_sei.h: Language not supported
  • libavcodec/cbs_sei_syntax_template.c: Language not supported
  • libavcodec/h2645_sei.c: Language not supported
  • libavcodec/h2645_sei.h: Language not supported
  • libavcodec/h26x/h2656_inter_template.c: Language not supported
  • libavcodec/h274.c: Language not supported
  • libavcodec/h274.h: Language not supported
  • libavcodec/vvc.h: Language not supported
  • libavcodec/vvc/Makefile: Language not supported
  • libavcodec/vvc/cabac.c: Language not supported
  • libavcodec/vvc/cabac.h: Language not supported
  • libavcodec/vvc/ctu.c: Language not supported
  • libavcodec/vvc/ctu.h: Language not supported
  • libavcodec/vvc/data.c: Language not supported
Comments suppressed due to low confidence (1)

.github/workflows/makefile.yml:26

  • [nitpick] The matrix entry 'clang-usan' may be confusing since the similar 'clang-asan' is also present. Consider clarifying the naming difference or adding a comment to indicate the intended purpose.
- { name: clang-usan, flags: '--toolchain=clang-usan' }

@QSXW
Copy link
Collaborator Author

QSXW commented Apr 6, 2025

Current Progress

+++++++++ report +++++++++
passed files:
    12b444SPwpp_A_OPPO_1.bit
    16b400P16_A_Sony_2.bit
    16b400P16_B_Sony_2.bit
    16b400P16_C_Sony_2.bit
    16b400P16_D_Sony_2.bit
    16b400P16_E_Sony_2.bit
    16b420P16_A_Sony_2.bit
    16b420P16_B_Sony_2.bit
    16b420P16_C_Sony_2.bit
    16b420P16_D_Sony_2.bit
    16b420P16_E_Sony_2.bit
    16b422P16_A_Sony_2.bit
    16b422P16_B_Sony_2.bit
    16b422P16_C_Sony_2.bit
    16b422P16_D_Sony_2.bit
    16b422P16_E_Sony_2.bit
    16b444Iepp_A_Sharp_3.bit
    16b444Ierrc_A_Qualcomm_2.bit
    16b444Ietsrc_A_Kwai_2.bit
    16b444Iprrc_A_Qualcomm_2.bit
    16b444Irlscp_A_OPPO_2.bit
    16b444Ivvc1_A_Alibaba_2.bit
    16b444Iwpp_A_OPPO_1.bit
    16b444SPepp_A_Sharp_3.bit
    16b444SPerrc_A_Qualcomm_2.bit
    16b444SPetsrc_A_Kwai_2.bit
    16b444SPetsrc_B_Kwai_2.bit
    16b444SPetsrc_C_Kwai_2.bit
    16b444SPetsrc_D_Kwai_2.bit
    16b444SPetsrc_E_Kwai_2.bit
    16b444SPetsrc_F_Kwai_2.bit
    16b444SPetsrc_G_Kwai_2.bit
    16b444SPetsrc_H_Kwai_2.bit
    16b444SPprrc_A_Qualcomm_2.bit
    16b444SPrlscp_A_OPPO_2.bit
    16b444SPvvc1_A_Alibaba_2.bit
    16b444SPwpp_A_OPPO_1.bit
    16b444epp_A_Sharp_3.bit
    16b444errc_A_Qualcomm_2.bit
    16b444errc_B_Qualcomm_2.bit
    16b444errc_C_Qualcomm_2.bit
    16b444etsrc_A_Kwai_2.bit
    16b444prrc_A_Qualcomm_2.bit
    16b444rlscp_A_OPPO_2.bit
    16b444vvc1_A_Alibaba_2.bit
    16b444wpp_A_OPPO_1.bit

total = 46, passed = 46, skipped = 0, failed = 0
----------

@QSXW
Copy link
Collaborator Author

QSXW commented Apr 13, 2025

Hi @nuomi2021,

All 16 bits clips have passed the conformance test with my work. I'll update the commit soon.

And it looks like there are a lot of md5 are different from the output of the lastest VTM. I regenerated a new md5.txt for 16 bits clips using the VTM DecoderApp.exe.

919390752070fa8336bbf58f1667e2f3  12b444SPwpp_A_OPPO_1.bit
42b7b2991be767a25afe5cbae9dd4e8d  16b400P16_A_Sony_2.bit
b5c82e0df75c557560ef1081526b78e2  16b400P16_B_Sony_2.bit
d4e4d329736c703c09ac76120bb1ce70  16b400P16_C_Sony_2.bit
385d13f359c3224dbbc2ed3e9577949a  16b400P16_D_Sony_2.bit
1a7defbd5fbba309701de1ad54fd6c6e  16b400P16_E_Sony_2.bit
1849bc4a9792133ff6fb8c76d4d851e1  16b420P16_A_Sony_2.bit
c1809287ea51e972d9fad9fc1076ba91  16b420P16_B_Sony_2.bit
193b6df8049063b01e97d2c7a990aa97  16b420P16_C_Sony_2.bit
d643675f7f356f35e1225f62d34f7801  16b420P16_D_Sony_2.bit
0c4a6a7c9836ca79546594a71ee77c37  16b420P16_E_Sony_2.bit
db9d5cc717523a323f8d4086cff096eb  16b422P16_A_Sony_2.bit
e029846ccf9a97baf35e48e6807740f8  16b422P16_B_Sony_2.bit
474108fa8a32c268f7fec11aa804d2c5  16b422P16_C_Sony_2.bit
db3b2608cc5f0dd563ff081260dc1945  16b422P16_D_Sony_2.bit
e78b3122c6178a8a4b9ba726348a1765  16b422P16_E_Sony_2.bit
b8a3e2833999875af3f3ca742f34eee0  16b444epp_A_Sharp_3.bit
32a43d658bc07731966cee49a6dedfeb  16b444errc_A_Qualcomm_2.bit
50d603566185d648d13aef461d6a178d  16b444errc_B_Qualcomm_2.bit
b913fe94feaa06dfb927f2fd0757ae48  16b444errc_C_Qualcomm_2.bit
53e0a2bef4279958c0c840769dc07f0f  16b444etsrc_A_Kwai_2.bit
8d0b62c7e2975639233e2557e949f13b  16b444Iepp_A_Sharp_3.bit
3042e52aadfceb6466b5648084f5e585  16b444Ierrc_A_Qualcomm_2.bit
70a8bcfc5503025bd5af7b9cdb51cda6  16b444Ietsrc_A_Kwai_2.bit
f871e788d05c2c835e61df3101055cf8  16b444Iprrc_A_Qualcomm_2.bit
429cef641d9056fa54144ddb4caa6e9b  16b444Irlscp_A_OPPO_2.bit
dd468bfebf43a1b070dc83f153d9bfe5  16b444Ivvc1_A_Alibaba_2.bit
9e6daf42ba2452ea49b6858d9addcc0d  16b444Iwpp_A_OPPO_1.bit
6b6f9c5f0bbe7bc4dd1e450523af932c  16b444prrc_A_Qualcomm_2.bit
577454220ab030066f8a0e38932e75e5  16b444rlscp_A_OPPO_2.bit
b92925e3f4c91b03928a11e9cda5ee7b  16b444SPepp_A_Sharp_3.bit
8b996da8e023d57a9e4a4b154f67b7b8  16b444SPerrc_A_Qualcomm_2.bit
8ef7eb0a10492be8d5919278340b3b76  16b444SPetsrc_A_Kwai_2.bit
c6b63af27b130d976a48bda224a6d6d6  16b444SPetsrc_B_Kwai_2.bit
6bb9195ff424ee2ef314d5df65b65f6e  16b444SPetsrc_C_Kwai_2.bit
730dd9b350c908fe6d90d4d1c4fe7401  16b444SPetsrc_D_Kwai_2.bit
c7de5b2e92aa0cbd2d8e253770905e39  16b444SPetsrc_E_Kwai_2.bit
74b943117a3393e6323e10d870655db6  16b444SPetsrc_F_Kwai_2.bit
0f9fa19d772d5ef9b802ba8439581763  16b444SPetsrc_G_Kwai_2.bit
fc5eb8d84e16de9a9d4026251cb2371c  16b444SPetsrc_H_Kwai_2.bit
5f49aedb923cb97eaade3ecdf993e250  16b444SPprrc_A_Qualcomm_2.bit
364f190f0cde49ce82c02126d284a2b5  16b444SPrlscp_A_OPPO_2.bit
dcdd6fc022a56a9f6329c432aa92f82a  16b444SPvvc1_A_Alibaba_2.bit
0ac7c1412207ec2978f9c00f3c1f63d7  16b444SPwpp_A_OPPO_1.bit
1fc040dd023cd452658730985ff3dfa8  16b444vvc1_A_Alibaba_2.bit
b430c873fb453b36d1dcde19e051716f  16b444wpp_A_OPPO_1.bit

You can try ./DecoderApp.exe -i 16b400P16_B_Sony_2.bit -o 16b400P16_B_Sony_2.yuv and generate the md5, and you will find it is different from the md5 downloaded from VTM test.
image

After my change, our result will match the latest VTM.

@QSXW QSXW mentioned this pull request Apr 13, 2025
@nuomi2021
Copy link
Member

is the vtm conformance set updated?

@QSXW
Copy link
Collaborator Author

QSXW commented Apr 14, 2025

is the vtm conformance set updated?

Yeah. I manually downloaded the clips for each version and found that they doesn't match the md5 of latest DecderApp.exe.

@QSXW QSXW force-pushed the feat/16bits branch 2 times, most recently from becb196 to 370d2ca Compare April 14, 2025 20:49
@QSXW QSXW force-pushed the feat/16bits branch 2 times, most recently from d6d9363 to 9acadeb Compare April 27, 2025 17:37
@QSXW
Copy link
Collaborator Author

QSXW commented May 2, 2025

@nuomi2021 Is it necessary to add support for 13/15 bit depth? We can support decoding by simply adding VVC_DSP(15), but it may not be used by any user. Maybe we can just support 14 and 16 bits, which is enough.

@nuomi2021
Copy link
Member

Even though 14-bit support isn't needed right now, we can make the code flexible in case someone wants to add it in the future

@QSXW
Copy link
Collaborator Author

QSXW commented May 2, 2025

Even though 14-bit support isn't needed right now, we can make the code flexible in case someone wants to add it in the future

Updated!

pixel* dst = (pixel*)_dst;
const int ps = BIT_DEPTH >> 3;

int16_t *gh0 = (int16_t *)gradient_h[0];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prof_grad_filter is a local function, so we do not need to covert it to int16 _t, just use tpixel.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes sure.

const int hs = fc->ps.sps->hshift[c_idx];
const int vs = fc->ps.sps->vshift[c_idx];
const int idx = av_log2(block_w) - 1;
const int ps = fc->ps.sps->bit_depth + 2 >> 3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use sps->pixel_shift, if not possible, better use some macro here to tell reader why we need to * ps

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(1 << sps->pixel_shift) will be fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seemed that sps->pixel_shift is not possible for that I want to round(14) to 16 so why we plus 2
10 + 2 = 12; 12 / 8 = 1
12 + 2 = 14; 14 / 8 = 1
14 + 2 = 16; 16 / 8 = 2
16 + 2 = 18; 18 / 8 = 2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better use a macro, or comment why we can not use pixel_shift here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to define 14 bits's tpixel to 32?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The VTM requires the high bit-depth macro to be enabled when the bit depth is greater than 12.

See https://vcgit.hhi.fraunhofer.de/jvet/VVCSoftware_VTM/-/blob/master/source/App/EncoderApp/EncAppCfg.cpp#L4770

@nuomi2021
Copy link
Member

@QSXW, could you please help update the MD5 checksums in the tests?
Thank you

@QSXW
Copy link
Collaborator Author

QSXW commented May 29, 2025

@QSXW, could you please help update the MD5 checksums in the tests? Thank you

Sure. See ffvvc/tests#53

@QSXW QSXW force-pushed the feat/16bits branch 2 times, most recently from a9603db to c857a78 Compare May 29, 2025 19:04
QSXW and others added 29 commits June 11, 2025 03:26
…tdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…bitdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…h bitdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…igh bitdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…igh bitdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
… high bitdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
This commit fixed the decoding process for geometric partitioning mode inter blocks

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…bitdepth

This commit fixed the fetching samples process for Bi-directional optical flow prediction process

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…tdepth

This commit fixed the gradient filter for prediction refinement with optical flow process

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
This commit fixed the prediction refinement with optical flow process

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…epth

This commit fixed the prediction refinement with optical flow process

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…tdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
This commit fixed the Bi-directional optical flow prediction process

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…for high bitdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…r high bitdepth

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…tdepth

This commit fixed Coding tree block filtering process for luma samples

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…bitdepth

This commit fixed Coding tree block filtering process for chroma samples

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
…nst int

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
passed files:
    16b400P16_A_Sony_2.bit
    16b400P16_B_Sony_2.bit
    16b400P16_C_Sony_2.bit
    16b400P16_D_Sony_2.bit
    16b400P16_E_Sony_2.bit
    16b420P16_A_Sony_2.bit
    16b420P16_B_Sony_2.bit
    16b420P16_C_Sony_2.bit
    16b420P16_D_Sony_2.bit
    16b420P16_E_Sony_2.bit
    16b422P16_A_Sony_2.bit
    16b422P16_B_Sony_2.bit
    16b422P16_C_Sony_2.bit
    16b422P16_D_Sony_2.bit
    16b422P16_E_Sony_2.bit
    16b444Iepp_A_Sharp_3.bit
    16b444Ierrc_A_Qualcomm_2.bit
    16b444Ietsrc_A_Kwai_2.bit
    16b444Iprrc_A_Qualcomm_2.bit
    16b444Irlscp_A_OPPO_2.bit
    16b444Ivvc1_A_Alibaba_2.bit
    16b444Iwpp_A_OPPO_1.bit
    16b444SPepp_A_Sharp_3.bit
    16b444SPerrc_A_Qualcomm_2.bit
    16b444SPetsrc_A_Kwai_2.bit
    16b444SPetsrc_B_Kwai_2.bit
    16b444SPetsrc_C_Kwai_2.bit
    16b444SPetsrc_D_Kwai_2.bit
    16b444SPetsrc_E_Kwai_2.bit
    16b444SPetsrc_F_Kwai_2.bit
    16b444SPetsrc_G_Kwai_2.bit
    16b444SPetsrc_H_Kwai_2.bit
    16b444SPprrc_A_Qualcomm_2.bit
    16b444SPrlscp_A_OPPO_2.bit
    16b444SPvvc1_A_Alibaba_2.bit
    16b444SPwpp_A_OPPO_1.bit
    16b444epp_A_Sharp_3.bit
    16b444errc_A_Qualcomm_2.bit
    16b444errc_B_Qualcomm_2.bit
    16b444errc_C_Qualcomm_2.bit
    16b444etsrc_A_Kwai_2.bit
    16b444prrc_A_Qualcomm_2.bit
    16b444rlscp_A_OPPO_2.bit
    16b444vvc1_A_Alibaba_2.bit
    16b444wpp_A_OPPO_1.bit

Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants