Repository navigation
Run the CCSO search sample passes on the worker threads - #5616
Open
chengchen-google wants to merge 1 commit into
Open
chengchen-google wants to merge 1 commit into
chengchen-google wants to merge 1 commit into
Conversation
chengchen-google
force-pushed
the
s19-0001
branch
from
October 23, 2026 21:23
2abfefc to
c8b6630
Compare
The CCSO search evaluates up to 116 filter candidates per plane. For each candidate it classifies every luma sample of the frame, accumulates the per class error statistics, and for every trained filter copies the reconstructed plane, filters it and computes the per filter unit distortion. These full frame passes run on the main thread while the tile worker threads wait. This commit proposes to process these passes with multi-thread. It process the frame filter row by row, each writes only its own samples of the classification and reconstruction buffers. It splits the plane evenly across the encoder worker threads. The new speed feature enable_ccso_mt is introduced. It is off with one thread and on for multi-threads. Results on RA A1 (17 frames), A2 (33 frames) show a significant encoder speed up (~20%) for A1 at speed 1. The speed up is less for A2 because A1 uses 4 threads. The more threads, the higher speed up is expected. Also, after speed 2, the CCSO search is optimized and the number of searches is significantly reduced. Therefore the speed up for speed 2 and above is less. Full results: +-------+-------+-------+-------+-------+-------+-------+-------+ | Speed | Class | Y | Cb | Cr | wAvg | Enc% | Dec% | +-------+-------+-------+-------+-------+-------+-------+-------+ | 1 | A1 | +0.00 | +0.00 | +0.00 | +0.00 | 79.4 | 101.7 | | 1 | A2 | +0.00 | +0.00 | +0.00 | +0.00 | 95.7 | 97.8 | +-------+-------+-------+-------+-------+-------+-------+-------+ | 2 | A1 | +0.00 | +0.00 | +0.00 | +0.00 | 98.5 | 99.2 | | 2 | A2 | +0.00 | +0.00 | +0.00 | +0.00 | 98.6 | 101.1 | +-------+-------+-------+-------+-------+-------+-------+-------+ | 3 | A1 | +0.00 | +0.00 | +0.00 | +0.00 | 98.6 | 95.5 | | 3 | A2 | +0.00 | +0.00 | +0.00 | +0.00 | 98.6 | 96.9 | +-------+-------+-------+-------+-------+-------+-------+-------+ | 4 | A1 | +0.00 | +0.00 | +0.00 | +0.00 | 98.3 | 101.7 | | 4 | A2 | +0.00 | +0.00 | +0.00 | +0.00 | 99.1 | 101.3 | +-------+-------+-------+-------+-------+-------+-------+-------+ | 5 | A1 | +0.00 | +0.00 | +0.00 | +0.00 | 97.8 | 100.0 | | 5 | A2 | +0.00 | +0.00 | +0.00 | +0.00 | 99.3 | 97.5 | +-------+-------+-------+-------+-------+-------+-------+-------+ | 6 | A1 | +0.00 | +0.00 | +0.00 | +0.00 | 97.0 | 99.1 | | 6 | A2 | +0.00 | +0.00 | +0.00 | +0.00 | 100.1 | 103.6 | +-------+-------+-------+-------+-------+-------+-------+-------+ This is a bit-exact change. We also add a unit test test/encoder_frame_mt_test.cc. It encodes a clip with 1, 2, 3 and 4 threads and checks that the compressed frames and the decoded frames are identical. Change-Id: I4a5db90932afc67b29f72315b2ee060ceca01daa
chengchen-google
force-pushed
the
s19-0001
branch
from
October 23, 2026 22:20
c8b6630 to
85f0303
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The CCSO search evaluates up to 116 filter candidates per plane. For each candidate it classifies every luma sample of the frame, accumulates the per class error statistics, and for every trained filter copies the reconstructed plane, filters it and computes the per filter unit distortion.
These full frame passes run on the main thread while the tile worker threads wait.
This commit proposes to process these passes with multi-thread. It process the frame filter row by row, each writes only its own samples of the classification and reconstruction buffers. It splits the plane evenly across the encoder worker threads.
The new speed feature enable_ccso_mt is introduced. It is off with one thread and on for multi-threads.
Results on RA A1 (17 frames), A2 (33 frames) show a significant encoder speed up (~20%) for A1 at speed 1. The speed up is less for A2 because A1 uses 4 threads. The more threads, the higher speed up is expected.
Also, after speed 2, the CCSO search is optimized and the number of searches is significantly reduced. Therefore the speed up for speed 2 and above is less.
Full results:
This is a bit-exact change.
We also add a unit test test/encoder_frame_mt_test.cc. It encodes a clip with 1, 2, 3 and 4 threads and checks that the compressed frames and the decoded frames are identical.