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

[encoder_ext]set iMinQp to 0 would lead to unexpected QP changing #3259

Closed
fulinjie opened this issue Mar 31, 2020 · 3 comments
Closed

[encoder_ext]set iMinQp to 0 would lead to unexpected QP changing #3259

fulinjie opened this issue Mar 31, 2020 · 3 comments

Comments

@fulinjie
Copy link
Contributor

While doing some integrations in FFmpeg, found that if either qmax or qmin is set to 0, unexpected QP changing would be observed.

Log:
Warning:Change QP Range from(0,51) to (12,42)

if ((pCfg->iMaxQp <= 0) || (pCfg->iMinQp <= 0))

https://github.com/cisco/openh264/blob/master/codec/encoder/core/src/encoder_ext.cpp#L375

@huili2
Copy link
Collaborator

huili2 commented Mar 31, 2020

Yes. Although QP=0 is allowed in Rec, it is not well supported here. You may first try to not use QP=0.

fulinjie added a commit to fulinjie/ffmpeg that referenced this issue Mar 31, 2020
Set default QP range to (1, 51) instead of (2, 32).

If iMaxQp/iMinQp equals 0, the QP range would be changed unexpectedly
inside libopenh264 with a warning:

Warning:Change QP Range from(0,51) to (12,42)

And QP = 0 is not well supported currently.

[1] <https://github.com/cisco/openh264/blob/master/codec/encoder/core/src/encoder_ext.cpp#L375>
[2] <cisco/openh264#3259>

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
@fulinjie
Copy link
Contributor Author

hi @huili2 , thanks for the information.

I'd like to reduce the qp range to (1, 51):
intel-media-ci/ffmpeg#188

fulinjie added a commit to fulinjie/ffmpeg that referenced this issue Apr 3, 2020
Set default QP range to (1, 51) instead of (2, 32).

QP = 0 is not well supported currently in libopenh264. If iMaxQp/iMinQp
equals 0, the QP range would be changed unexpectedly inside libopenh264
with a warning:

Warning:Change QP Range from(0,51) to (12,42)

[1] <https://github.com/cisco/openh264/blob/master/codec/encoder/core/src/encoder_ext.cpp#L375>
[2] <cisco/openh264#3259>

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
fulinjie added a commit to fulinjie/ffmpeg that referenced this issue Apr 11, 2020
Set default QP range to (1, 51) instead of (2, 32).

QP = 0 is not well supported currently in libopenh264. If iMaxQp/iMinQp
equals 0, the QP range would be changed unexpectedly inside libopenh264
with a warning:

Warning:Change QP Range from(0,51) to (12,42)

[1] <https://github.com/cisco/openh264/blob/master/codec/encoder/core/src/encoder_ext.cpp#L375>
[2] <cisco/openh264#3259>

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
fulinjie added a commit to fulinjie/ffmpeg that referenced this issue Apr 28, 2020
Clip iMinQp/iMaxQp to (1, 51) if user specified qp range
explicitly since QP = 0 is not well supported currently
in libopenh264, otherwise leave iMinQp/iMaxQp untouched
and use the values initialized in FillDefault().

Note that if iMaxQp/iMinQp equals 0, the QP range would
be adjusted inside libopenh264 with a warning:

Warning:Change QP Range from(0,51) to (12,42)

<https://github.com/cisco/openh264/blob/master/codec/encoder/core/src/encoder_ext.cpp#L375>
<cisco/openh264#3259>

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
@fulinjie
Copy link
Contributor Author

Filed a PR to change the the verbosity level in case we ran into this warning all the time for qp = 0:
#3278

fulinjie added a commit to fulinjie/ffmpeg that referenced this issue Apr 28, 2020
Clip iMinQp/iMaxQp to (1, 51) if user specified a non-zero qp
range explicitly.

If setting iMinQp/iMaxQp to 0, the QP range would be adjusted
to use the defaults inside libopenh264 library according to
the usage type.

If not set, leave iMinQp/iMaxQp untouched and use the values
initialized in FillDefault().

<https://github.com/cisco/openh264/blob/master/codec/encoder/core/src/encoder_ext.cpp#L375>
<cisco/openh264#3259>

Signed-off-by: Linjie Fu <linjie.fu@intel.com>
@huili2 huili2 closed this as completed Dec 23, 2022
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