AOME_SET_ACTIVEMAP clarification

324 views
Skip to first unread message

Haseeb Abdul Qadir

unread,
Jan 26, 2024, 9:03:06 AMJan 26
to AV1 Discussion

Hello,

I'm encountering a problem with the active map feature in the libaom codec. Specifically, I am using aom_codec_control with AOME_SET_ACTIVEMAP and passing a uint8_t array to define active areas for encoding. Each element is set to 1 for 16x16 blocks designated for encoding and 0 for blocks to be excluded.

However, the library seems to disregard this active map, encoding the entire content regardless. This behaviour is in contrast to my experience with libvpx, where the active map is respected – areas marked 0 are ignored, while those marked 1 are encoded.

Is there a difference in how libaom's active map feature works compared to libvpx's? Am I possibly implementing it incorrectly in the libaom context? Furthermore, is there a way to instruct libaom's encoder to selectively not encode specific sections of a frame?

Any insights or suggestions would be greatly appreciated.

Thank you.

Marco Paniconi

unread,
Feb 2, 2024, 12:43:57 PMFeb 2
to AV1 Discussion, Haseeb Abdul Qadir
Hi,

We haven't used/test active_maps much in libaom, so some fixes may be needed.

I just tried using active_maps for the rtc encoder, example command line I uses is:
examples/svc_encoder_rtc -tl 1 -sl 1 -lm 0 -sp 10 -aq 0 -k 1000 -bl 500 -b 500 input720p.y4m -o out.av1

It seems I had to make a few changes to make it work, uploaded here for reference: https://aomedia-review.googlesource.com/c/aom/+/186985

Can you try it out and let me know if it works, or what issues you see. Also what encoding mode are you using (real-time or not, speed setting, etc)?

-marco

Haseeb Abdul Qadir

unread,
Feb 3, 2024, 5:12:03 AMFeb 3
to Marco Paniconi, AV1 Discussion
Thanks for looking into this Marco, I really appreciate it.

1. I'm using real-time mode with speed = 11 and AQ set to 3 (cyclic refresh).

2. I tried your changes - although it seems to work wrt to limiting the encoded region, I am seeing artifacts. I've attached a screenshot below.

image.png

Thanks.

Marco Paniconi

unread,
Feb 5, 2024, 12:36:11 PMFeb 5
to AV1 Discussion, Haseeb Abdul Qadir, AV1 Discussion, Marco Paniconi
For the artifacts: can you send the command line with the clip and map used?

Regarding cyclic refresh: it was being disabled when active_maps was enabled, that should be fixed in the latest uploaded patch.

Haseeb Abdul Qadir

unread,
Feb 5, 2024, 1:52:58 PMFeb 5
to Marco Paniconi, AV1 Discussion
Hi Macro,

Thanks again for looking into this: I wasn't using the command line - I was actually using this part of a larger app which is actively updating the active map.

Let me try to reproduce this from the CLI. Btw - do you have a link to a test video that I can pass to the CLI?

Thanks.

Marco Paniconi

unread,
Feb 5, 2024, 2:22:37 PMFeb 5
to AV1 Discussion, Haseeb Abdul Qadir, AV1 Discussion, Marco Paniconi
Hi Haseeb,

You can try FourPeople from here: https://media.xiph.org/video/derf/. Or if you find a more suitable clip for your testing that you can share it, that would be fine.

-marco

Haseeb Abdul Qadir

unread,
Feb 24, 2024, 4:41:13 PMFeb 24
to Marco Paniconi, AV1 Discussion
Hi Marco,

Sorry for the late reply. I think I have a repro going with your latest patch set (https://aomedia-review.googlesource.com/c/aom/+/186985)

Here's a screenshot of set_maps.exe without the patch (on the left) and with the patch (on the right). VLC is on the last frame of the output and notice the one with the patch has blocks on the right edge of the picture and the bird's wings are also distorted somewhat. I think within my app, I'm seeing the something similar - distortion along 16x16 or 8x8 regions.

image.png


Here are the video files incase you want to try it out yourself: https://drive.google.com/drive/folders/122H7CQI-EOT5us_eoUrFL9QfLdE4O6Li?usp=sharing

PS. I'm not sure why the colors are off in VLC - I tried with ffmpeg as well and it had the same problem.

Thanks.

Haseeb Abdul Qadir

unread,
Feb 24, 2024, 5:46:34 PMFeb 24
to Marco Paniconi, AV1 Discussion
Also, here's the command line used incase it helps:

set_maps.exe av1 352 288 bowing_cif.y4m bowing_cif-output.y4m

Marco Paniconi

unread,
Feb 26, 2024, 2:45:20 PMFeb 26
to Haseeb Abdul Qadir, AV1 Discussion
Thanks, I will take a look. Did you attach the setmap.exe for the command line?

Haseeb Abdul Qadir

unread,
Feb 26, 2024, 8:30:34 PMFeb 26
to Marco Paniconi, AV1 Discussion
Hi Marco,

I just added both binaries (set_maps_with_patch.exe and set_maps_no_patch.exe) to the Google Drive folder.

Thanks.

Haseeb Abdul Qadir

unread,
Mar 4, 2024, 5:19:33 PMMar 4
to Marco Paniconi, AV1 Discussion
Hi Marco,

The latest patchset (16) fixes the corruption problem I was seeing when using active maps and content_mode = AOM_CONTENT_SCREEN.

Thanks a ton for fixing this Marco!
Reply all
Reply to author
Forward
0 new messages