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

[WIP] encoder: allow 1 CDEF bits for key frames #1788

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tmatth
Copy link
Member

@tmatth tmatth commented Oct 21, 2019

This exposes a weird issue, where rdo_loop_decision gets stuck in an infinite loop where it's alternating between two loop restoration filters:

New best_new_lrf Sgrproj 12 0 -20
New best_new_lrf Sgrproj 13 0 -24
New best_new_lrf Sgrproj 12 0 -20
New best_new_lrf Sgrproj 13 0 -24
New best_new_lrf Sgrproj 12 0 -20
New best_new_lrf Sgrproj 13 0 -24
New best_new_lrf Sgrproj 12 0 -20
....

@xiphmont any ideas?

To reproduce (with this branch):

target/release/rav1e /derf-media/objective-1-fast/aspen_1080p_60f.y4m --quantizer 172 -o out.ivf

@coveralls
Copy link
Collaborator

coveralls commented Oct 21, 2019

Coverage Status

Coverage increased (+0.02%) to 75.593% when pulling 4158287 on feature/better-cdef-strengths into e4683b1 on master.

@KyleSiefring
Copy link
Collaborator

KyleSiefring commented Oct 21, 2019

The loop in rdo_loop_decision iterates until both cdef or lrf have stopped changing. Are you sure cdef isn't changing as well?

@xiphmont
Copy link
Contributor

xiphmont commented Oct 21, 2019 via email

@tmatth
Copy link
Member Author

tmatth commented Oct 21, 2019

The loop in rdo_loop_decision iterates until both cdef or lrf have stopped changing. Are you sure cdef isn't changing as well?

No, cdef_change is always false here, it's just lrf_change that is always true (because it keeps flipping).

@xiphmont
Copy link
Contributor

OK, I see what's happening. The logic behind my 'cost always goes down' invariant is incorrect.

@ycho ycho requested a review from xiphmont October 22, 2019 20:53
Copy link
Contributor

@xiphmont xiphmont left a comment

Choose a reason for hiding this comment

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

r+

The bug being caused in loop rdo is unrelated and I will fix it separately-- this change is simply triggering it.

@tmatth
Copy link
Member Author

tmatth commented Oct 22, 2019

r+

The bug being caused in loop rdo is unrelated and I will fix it separately-- this change is simply triggering it.

Yeah that's what I gathered, unfortunately I can't run AWCY for this PR until that bug gets fixed (speaking of which, should I open a proper issue?)

@ycho
Copy link
Collaborator

ycho commented Oct 22, 2019

OK, I see what's happening. The logic behind my 'cost always goes down' invariant is incorrect.

_ Okay, I haven't seen this.
Nice catch, @tmatth!

src/encoder.rs Outdated
@@ -855,6 +855,9 @@ impl<T: Pixel> FrameInvariants<T> {
}

pub fn set_quantizers(&mut self, qps: &QuantizerParameters) {
if self.frame_type == FrameType::KEY {
self.cdef_bits = 1;
Copy link
Collaborator

Choose a reason for hiding this comment

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

So, don't need more bits even for smaller QPs?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ycho as this is a work in progress, I'm planning on refining further once I can get some AWCY runs working (see above), this is just to get a baseline idea first.

@xiphmont
Copy link
Contributor

PR #1800 fixes your test case.

@tmatth tmatth force-pushed the feature/better-cdef-strengths branch from f1913ff to 1dce0c3 Compare October 28, 2019 12:35
@tmatth
Copy link
Member Author

tmatth commented Oct 28, 2019

PR #1800 fixes your test case.

Confirmed!

@lu-zero
Copy link
Collaborator

lu-zero commented Nov 1, 2019

@tmatth is this ready to land?

@tmatth
Copy link
Member Author

tmatth commented Nov 1, 2019

@tmatth is this ready to land?

No still a WIP.

@ycho
Copy link
Collaborator

ycho commented Dec 9, 2019

@tmatth is this ready to land?

No still a WIP.

Why? Still weird?!

@barrbrain barrbrain added the WorkInProgress Incomplete patchset label Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WorkInProgress Incomplete patchset
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants