-
Notifications
You must be signed in to change notification settings - Fork 12
Support PALETTE and Adaptive Color Transform #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
d9ae5a7 to
0dd9ff3
Compare
|
thank you @QSXW , will check it this week end. |
|
linux is not build able. +++++++++ report +++++++++ total = 21, passed = 5, skipped = 0, failed = 16 |
|
Sure. It's funny that I didn't test Alibaba_2.bit samples but they passed and other failed. |
|
sure, I will check it |
3037abd to
c600313
Compare
|
@QSXW , I know why other clips are failed. the Deblock, SAO, and ALF codes need to be added. |
Yes, it is. Do we have an interface to get the cu by x0,y0? We need to get cu_q and cu_p for getting the pred_mode? |
|
you can use fc->tab.cpm |
|
I think I've filtered out all the flaky fuzz failures now so these appear to be legitimate. AddressSanitizer report for ID 14. ID 56 is similar.AddressSanitizer report for ID 256. All other bitstreams are similar. |
…rocess Signed-off-by: Wu Jianhua <toqsxw@outlook.com>
|
we zero the table in ff_vvc_per_frame_init if the second params for tl_init
is true
tl_init(TabList *l, const int zero, const int realloc)
…On Sat, Mar 15, 2025 at 11:45 PM Wu Jianhua ***@***.***> wrote:
Hi @nuomi2021 <https://github.com/nuomi2021>. I use
init_traverse_scan_order to fill out the fc->tab.traverse_scan_order, but
when I used it in the stage of palette_coding. All the values of
traver_scan_order are zero. Looks like it's cleared or not initialized. Do
you know what the reason is? The codes works before I rebase then on the up
stream.
—
Reply to this email directly, view it on GitHub
<#224 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR75SZ6ZNGJ45N5Q7KNCSY32URDJPAVCNFSM6AAAAABZCPRKOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRWG42DSMJUGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: QSXW]*QSXW* left a comment (ffvvc/FFmpeg#224)
<#224 (comment)>
Hi @nuomi2021 <https://github.com/nuomi2021>. I use
init_traverse_scan_order to fill out the fc->tab.traverse_scan_order, but
when I used it in the stage of palette_coding. All the values of
traver_scan_order are zero. Looks like it's cleared or not initialized. Do
you know what the reason is? The codes works before I rebase then on the up
stream.
—
Reply to this email directly, view it on GitHub
<#224 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR75SZ6ZNGJ45N5Q7KNCSY32URDJPAVCNFSM6AAAAABZCPRKOKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMRWG42DSMJUGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
@nuomi2021 Please use this clip as test: 8b422_G_Sony_5.bit and use this branch https://github.com/QSXW/FFmpeg-VVC/commits/debug/palette/ This branch includes the picture hash sei so we can add |
We need to count in tree type. Please consider removing add_palette_tu, as the hls_transform_tree may be able to handle most of the tasks. |
|
use VTM to encode some no SAO, ALF clip will make your life easier :) |
It works! This change saved my life. This is the power of cooperation! |
Absolutely. For simplicity, I just changed the block of codes running sao and alf filter as comments at the present. Fortunately, there is no change need on sao and alf filter for palette mode. |
Hi Jianhua, |
|
Hi @nuomi2021 Thank you for your help! Now the palette changes only fails on the 8b444_A_Kwai_2.bit. I've check the file it looks like the difference occurred on the 1st picture and 10th ... pictures. I tried to compare the frame with VTM and there is only some cu are different and others are the same actually. I've updated the commits, and maybe you can have a try. Just ignore the SEI, the decoded picture hash is helpful for our debugging.
|
…ding unit
passed files:
ACT_A_Kwai_3.bit
ACT_B_Kwai_3.bit
Signed-off-by: Wu Jianhua <toqsxw@gmail.com>
Signed-off-by: Wu Jianhua <toqsxw@gmail.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>
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>
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:
FIELD_A_Panasonic_4.bit
FIELD_B_Panasonic_2.bit
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@gmail.com>
|
Hi @nuomi2021. With my latest commit, all the PAL and ACT tests have passed the conformance test. The issue is caused by the incorrect ciip flag of PLT block leading to the incorrect boundary strength, then the deblocking filter doesn't output the right pixels. I didn't make the codes beautiful. Can you help polish them? |
|
Sure, I’ll do this. |
| if (max_palette_index > 0 && !run_copy_map[scan_pos - min_sub_pos] && PALETTE_RUN_TYPE(start_comp, xc, yc) == 0) { | ||
| current_palette_index = ff_vvc_palette_idx_idc(lc, max_palette_index, *adjust); | ||
| if (scan_pos > 0) { | ||
| adjusted_ref_palette_index = max_palette_index + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This assignment will be replaced by the following if-else block. Why doesn't this code follow the specification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually following the VTM. Following the spec doesn't work. Maybe you can compare the codes with VTM/CABACReader.cpp/cu_palette_info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can report a bug to VTM.
| int width = tu->tbs[start_comp].tb_width; | ||
| int height = tu->tbs[start_comp].tb_height; | ||
|
|
||
| uint32_t (*scan_order)[2] = (uint32_t (*)[2])lc->fc->tab.traverse_scan_order[palette_transpose_flag ? TRAV_VERT : TRAV_HORIZ][av_log2(width) - 1][av_log2(height) - 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QSXW could you help generate const tables like
ff_vvc_diag_scan_x and ff_vvc_diag_scan_y
it should like this:
ff_vvc_trav_scan_x[2 /* transpose /][6 / log_width - 1][6 /* log_height - 1][64 x 64]
patch to data.c and data.h is enough. I can handle others.
you can use xxd like this
echo Hello World\! > temp
xxd -i temp
Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But is needs 576k memory for sizeof(ff_vvc_trav_scan_x) + sizeof(ff_vvc_trav_scan_y). The diag scan only needs 12.5 k. Is it worth adding it as a constant table? If we add trav scan as constant table, it means the ffmpeg.exe will increased with 576k memory... Or we may act like crc.c, only enable the constant table when CONFIG_HARDCODED_TABLES is enabled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anyway. Check patch.
0001-avcodec-vvc-data-add-ff_vvc_trav_scan_x-and-ff_vvc_t.patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point!
From the pattern, if there's no transpose, the first two lines for x are sufficient. We can use a table for x:
ff_vvc_trav_scan_x[2 /* transpose */][6 /* log_width - 1 */][6 /* log_height - 1 */][64 * 2]
Not sure if we have the same pattern for y and the transpose case.
It's worth looking into :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en, ff_vvc_trav_scan_x[0] and ff_vvc_trav_scan_y[1] are the same table.
So you can use the only one.
also for ff_vvc_trav_scan_x[1], scan_pos / width is the x.
we can use scan_pos >> log2_width to do the calcation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use ff_vvc_trav_scan_x to initialize a lc->fc->tab.traverse_scan_order_x[2][6][6] and lc->fc->tab.traverse_scan_order_y[2][6][6]. Only need two variable with total 144 bytes to avoid the extra index calculation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for odd lines,
x = pos & (width - 1)
y = pos >> log2_width;
If we can find a solution for both even and odd lines. we do not need the table anymore.
will check it tomorrow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seemed to be awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, we can do this with
const int mask = width - 1;
const int x = (pos & mask) ^ (-((pos >> log_width) & 1) & mask);
|
merged as a65d028 |




No description provided.