Skip to content
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

ROI-based encoding, the block artifacts and ROI region offset issue. #389

Open
mlkk518 opened this issue Jan 29, 2024 · 5 comments
Open

Comments

@mlkk518
Copy link

mlkk518 commented Jan 29, 2024

Thank you very much for your open source work. I am using your code to test ROI-based encoding, and the block effect is especially obvious at low compression rates, and the region corresponding to the ROI mask is also offset from the actual region. The input image I am using is 640x640x3, and the ROI mask is also of equal size. In the ROI.txt file, I set the parameters as follows.

roi.txt:
640 640
20 20 ... 20 (repeat 640)
20 20 ... 20
....
(640x640 array)
where the value of the ROI region is 10, and the NROI is 20. Could you please tell me what is the reason, and how can I solve it? Thank you very much!

The following is the experimental results:

(1) Original image:
12419

(2) ROI mask:
ROI

(3) Decoded image: (bpp=0.0392)
0 0392_12419

Looking forward to your early reply!

@Jovasa
Copy link
Member

Jovasa commented Jan 29, 2024

640x640x3, and the ROI mask is also of equal size.

Currently the minimum size of a single ROI region in Kvazaar is 64x64, if you are using a 640x640 ROI map, then the value in the top left corner for each 64x64 area is going to be used.

Can you provide the command line that used for compressing the image?

@mlkk518
Copy link
Author

mlkk518 commented Jan 30, 2024

640x640x3, and the ROI mask is also of equal size.

Currently the minimum size of a single ROI region in Kvazaar is 64x64, if you are using a 640x640 ROI map, then the value in the top left corner for each 64x64 area is going to be used.

Can you provide the command line that used for compressing the image?

The size of the minimal CTU is 64x64. Can I say that kvazaar doesn't do a good job of achieving a finer rate distribution for ROI-based image compression? Or is there any way to solve this block effect and positional offset problem?

The command: kvazaar -i input.yuv --input-res 640x640 --qp 49 --frame 1 -o compressed.hevc

@Jovasa
Copy link
Member

Jovasa commented Jan 30, 2024

The size of the minimal CTU is 64x64. Can I say that kvazaar doesn't do a good job of achieving a finer rate distribution for ROI-based image compression? Or is there any way to solve this block effect and positional offset problem?

Technically it would be possible to set the ROI granularity to CU level, which would require some fairly minor changes to Kvazaar. However, the bigger problem is that without some fairly large changes to Kvazaar, you cannot guarantee that the encoder will split CTUs in a way that guarantees that the ROI is exactly the area that you would want, in which case you would anyways want to set the ROI at CTU level.

The command: kvazaar -i input.yuv --input-res 640x640 --qp 49 --frame 1 -o compressed.hevc

You are setting the base QP to 49 and then adding 20 to non ROI areas and 10 to ROI areas resulting in QP 51, i.e., the worst quality to be used in the whole frame, try setting the base QP to around 22-27 and you could be able to distinguish the ROI and non-ROI from the decoded image.

@mlkk518
Copy link
Author

mlkk518 commented Jan 30, 2024

The size of the minimal CTU is 64x64. Can I say that kvazaar doesn't do a good job of achieving a finer rate distribution for ROI-based image compression? Or is there any way to solve this block effect and positional offset problem?

Technically it would be possible to set the ROI granularity to CU level, which would require some fairly minor changes to Kvazaar. However, the bigger problem is that without some fairly large changes to Kvazaar, you cannot guarantee that the encoder will split CTUs in a way that guarantees that the ROI is exactly the area that you would want, in which case you would anyways want to set the ROI at CTU level.

The command: kvazaar -i input.yuv --input-res 640x640 --qp 49 --frame 1 -o compressed.hevc

You are setting the base QP to 49 and then adding 20 to non ROI areas and 10 to ROI areas resulting in QP 51, i.e., the worst quality to be used in the whole frame, try setting the base QP to around 22-27 and you could be able to distinguish the ROI and non-ROI from the decoded image.

Thank you very much! I applied ROI compression again at 64x64 CTU level. However, there are still severe block artifacts, and accurate ROI region compression is not possible.

@Jovasa
Copy link
Member

Jovasa commented Jan 31, 2024

The command: kvazaar -i input.yuv --input-res 640x640 --qp 49 --frame 1 -o compressed.hevc

You are setting the base QP to 49 and then adding 20 to non ROI areas and 10 to ROI areas resulting in QP 51, i.e., the worst quality to be used in the whole frame, try setting the base QP to around 22-27 and you could be able to distinguish the ROI and non-ROI from the decoded image.

Thank you very much! I applied ROI compression again at 64x64 CTU level. However, there are still severe block artifacts, and accurate ROI region compression is not possible.

Did you change the base QP and to which value did you change it? Can you also provide the console output for the command?

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

No branches or pull requests

2 participants