[v1,0/4] media: rkvdec: Fix H.264 error resilience

Message ID 20221223193807.914935-1-nicolas.dufresne@collabora.com (mailing list archive)
Headers
Series media: rkvdec: Fix H.264 error resilience |

Message

Nicolas Dufresne Dec. 23, 2022, 7:38 p.m. UTC
  This patch serie changes the decoding mode from "exit on error"
to "keep decoding". Using this mode and re-enabling error detection
allow getting error resilience without loosing the ability to report
errors to userland. This have showed great results, but might be a
little more risky since this is not the mode that the reference code
uses and the documentation is very brief. With this in place,
userspace can chose to skip or display corrupted frames depending
on its application requirement. Previsouly, applicaiton would have
had no choice but to present the corrupted frames.

Changes since V1:
	- Removed merged patch
	- Changed usage of pr_debug into v4l2_dbg
	- Fix typos in commit messages and comments

Nicolas Dufresne (5):
  media: rkvdec: Disable H.264 error detection
  media: rkvdec: Add an ops to check for decode errors
  media: rkvdec: Fix RKVDEC_ERR_PKT_NUM macro
  media: rkvdec: Re-enable H.264 error detection
  rkvdec: Improve error handling

 drivers/staging/media/rkvdec/rkvdec-h264.c | 23 +++++++++++++--
 drivers/staging/media/rkvdec/rkvdec-regs.h |  2 +-
 drivers/staging/media/rkvdec/rkvdec.c      | 34 ++++++++++++++++++----
 drivers/staging/media/rkvdec/rkvdec.h      |  2 ++
 4 files changed, 51 insertions(+), 10 deletions(-)
  

Comments

Nicolas Dufresne Dec. 23, 2022, 7:51 p.m. UTC | #1
fyi, this cover letter was v2.

Le vendredi 23 décembre 2022 à 14:38 -0500, Nicolas Dufresne a écrit :
> This patch serie changes the decoding mode from "exit on error"
> to "keep decoding". Using this mode and re-enabling error detection
> allow getting error resilience without loosing the ability to report
> errors to userland. This have showed great results, but might be a
> little more risky since this is not the mode that the reference code
> uses and the documentation is very brief. With this in place,
> userspace can chose to skip or display corrupted frames depending
> on its application requirement. Previsouly, applicaiton would have
> had no choice but to present the corrupted frames.
> 
> Changes since V1:
> 	- Removed merged patch
> 	- Changed usage of pr_debug into v4l2_dbg
> 	- Fix typos in commit messages and comments
> 
> Nicolas Dufresne (5):
>   media: rkvdec: Disable H.264 error detection
>   media: rkvdec: Add an ops to check for decode errors
>   media: rkvdec: Fix RKVDEC_ERR_PKT_NUM macro
>   media: rkvdec: Re-enable H.264 error detection
>   rkvdec: Improve error handling
> 
>  drivers/staging/media/rkvdec/rkvdec-h264.c | 23 +++++++++++++--
>  drivers/staging/media/rkvdec/rkvdec-regs.h |  2 +-
>  drivers/staging/media/rkvdec/rkvdec.c      | 34 ++++++++++++++++++----
>  drivers/staging/media/rkvdec/rkvdec.h      |  2 ++
>  4 files changed, 51 insertions(+), 10 deletions(-)
>
  
Chen-Yu Tsai Dec. 26, 2022, 4:20 a.m. UTC | #2
On Sat, Dec 24, 2022 at 3:38 AM Nicolas Dufresne
<nicolas.dufresne@collabora.com> wrote:
>
> This patch serie changes the decoding mode from "exit on error"
> to "keep decoding". Using this mode and re-enabling error detection
> allow getting error resilience without loosing the ability to report
> errors to userland. This have showed great results, but might be a
> little more risky since this is not the mode that the reference code
> uses and the documentation is very brief. With this in place,
> userspace can chose to skip or display corrupted frames depending
> on its application requirement. Previsouly, applicaiton would have
> had no choice but to present the corrupted frames.
>
> Changes since V1:
>         - Removed merged patch
>         - Changed usage of pr_debug into v4l2_dbg
>         - Fix typos in commit messages and comments
>
> Nicolas Dufresne (5):
>   media: rkvdec: Disable H.264 error detection
>   media: rkvdec: Add an ops to check for decode errors
>   media: rkvdec: Fix RKVDEC_ERR_PKT_NUM macro
>   media: rkvdec: Re-enable H.264 error detection
>   rkvdec: Improve error handling

Apart from the minor comments in patch 3, the series is

Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>

Do we need to add the check_error_info op for VP9?

>  drivers/staging/media/rkvdec/rkvdec-h264.c | 23 +++++++++++++--
>  drivers/staging/media/rkvdec/rkvdec-regs.h |  2 +-
>  drivers/staging/media/rkvdec/rkvdec.c      | 34 ++++++++++++++++++----
>  drivers/staging/media/rkvdec/rkvdec.h      |  2 ++
>  4 files changed, 51 insertions(+), 10 deletions(-)
>
> --
> 2.38.1
>
  
Nicolas Dufresne Jan. 9, 2023, 8:18 p.m. UTC | #3
Le lundi 26 décembre 2022 à 12:20 +0800, Chen-Yu Tsai a écrit :
> On Sat, Dec 24, 2022 at 3:38 AM Nicolas Dufresne
> <nicolas.dufresne@collabora.com> wrote:
> > 
> > This patch serie changes the decoding mode from "exit on error"
> > to "keep decoding". Using this mode and re-enabling error detection
> > allow getting error resilience without loosing the ability to report
> > errors to userland. This have showed great results, but might be a
> > little more risky since this is not the mode that the reference code
> > uses and the documentation is very brief. With this in place,
> > userspace can chose to skip or display corrupted frames depending
> > on its application requirement. Previsouly, applicaiton would have
> > had no choice but to present the corrupted frames.
> > 
> > Changes since V1:
> >         - Removed merged patch
> >         - Changed usage of pr_debug into v4l2_dbg
> >         - Fix typos in commit messages and comments
> > 
> > Nicolas Dufresne (5):
> >   media: rkvdec: Disable H.264 error detection
> >   media: rkvdec: Add an ops to check for decode errors
> >   media: rkvdec: Fix RKVDEC_ERR_PKT_NUM macro
> >   media: rkvdec: Re-enable H.264 error detection
> >   rkvdec: Improve error handling
> 
> Apart from the minor comments in patch 3, the series is
> 
> Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
> 
> Do we need to add the check_error_info op for VP9?

In general, I try to avoid changes I cannot test. If you happen to have VP9 with
errors let me know. Looking quickly at the TRM, some part seems shared between
H.264 and VP9 indeed. Though, the TRM discourage from enabling the "keep
decoding on error" mode we use here.

> 
> >  drivers/staging/media/rkvdec/rkvdec-h264.c | 23 +++++++++++++--
> >  drivers/staging/media/rkvdec/rkvdec-regs.h |  2 +-
> >  drivers/staging/media/rkvdec/rkvdec.c      | 34 ++++++++++++++++++----
> >  drivers/staging/media/rkvdec/rkvdec.h      |  2 ++
> >  4 files changed, 51 insertions(+), 10 deletions(-)
> > 
> > --
> > 2.38.1
> >