linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [i.MX6][CODA] certain resolutions are not working in YUYV format
@ 2019-12-13 12:02 Benjamin Bara - SKIDATA
  2019-12-16 17:21 ` Michael Tretter
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Bara - SKIDATA @ 2019-12-13 12:02 UTC (permalink / raw)
  To: linux-arm, linux-media; +Cc: Richard Leitner - SKIDATA, p.zabel, m.tretter

Hey all,

we are currently facing a problem with the i.MX6DL and MPEG4-2 encoded videos.
The decoder seem to fail to decode videos of certain resolutions (video output becomes green).
For the latest test run, we used Linux kernel 5.4.2 and GStreamer version 1.16.1.

When hunting the problem down, it seems like the problem is related to the YUY2 (= YUYV) output format.
Unfortunately, gst always takes YUY2 as the default format for the v4l2mpeg4dec sink pad and 
forcing a different format does not work (video becomes even more green).

We saw commit d40e98c13b3e7cb1aa16e9c14f35db3c8c3dd033, which added YUYV if VDOA is used,
but could not find anything related in the i.MX 6Dual/6Quad VPU API Linux Reference Manual except:
"One pixel value of a component occupies one byte and the frame data is in YCbCr 4:2:0 format 
for H.264, H.264 and MPEG-4 codecs." [sic] (Rev. L3.0.35_1.1.0, 01/2013)

For debug purposes, we changed the dst_formats of the decoder driver to only support YUV420 (= I420).
All tested resolutions are working with this setup.

Does anyone else face similar issues?

Please just drop me a mail if we should perform further debug actions or provide further debug output.

BR,
Benjamin


*gst-launch pipeline to reproduce the error:*
gst-launch-1.0 -v videotestsrc ! video/x-raw,width=480,height=270 ! v4l2mpeg4enc output-io-mode=4 ! \
	v4l2mpeg4dec ! xvimagesink

*failing gst-launch pipeline to force the I420 format:*
gst-launch-1.0 -v videotestsrc ! video/x-raw,width=480,height=270 ! v4l2mpeg4enc output-io-mode=4 ! \
	v4l2mpeg4dec ! video/x-raw,format=I420 ! xvimagesink

*some other failing resolutions:*
- 320x200
- 400x270
- 400x300
- 480x250
- 480x270
- 480x500
- 640x200
- 800x600

*working resolutions:*
- 320x240
- 1024x576
- ...

*resulting dmesg output:*
[ 6159.838070] coda 2040000.vpu: CODA_COMMAND_SEQ_INIT failed, error code = 0x1
[ 6159.895636] coda 2040000.vpu: errors in 504 macroblocks
[ 6159.900877] coda 2040000.vpu: decoded frame index out of range: 0
[ 6160.963450] coda 2040000.vpu: CODA PIC_RUN timeout
[ 6162.003422] coda 2040000.vpu: CODA PIC_RUN timeout

*verbose output of failing gst-launch pipeline (GST_DEBUG=1):*
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/v4l2mpeg4enc:v4l2mpeg4enc0.GstPad:src: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)5, width=(int)480, height=(int)270, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/v4l2mpeg4dec:v4l2mpeg4dec0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)5, width=(int)480, height=(int)270, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Redistribute latency...
/GstPipeline:pipeline0/v4l2mpeg4enc:v4l2mpeg4enc0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/v4l2mpeg4dec:v4l2mpeg4dec0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)480, height=(int)270, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstXvImageSink:xvimagesink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)480, height=(int)270, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)30/1
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [i.MX6][CODA] certain resolutions are not working in YUYV format
  2019-12-13 12:02 [i.MX6][CODA] certain resolutions are not working in YUYV format Benjamin Bara - SKIDATA
@ 2019-12-16 17:21 ` Michael Tretter
  2019-12-17 11:52   ` Benjamin Bara - SKIDATA
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Tretter @ 2019-12-16 17:21 UTC (permalink / raw)
  To: Benjamin Bara - SKIDATA
  Cc: linux-arm, linux-media, Richard Leitner - SKIDATA, p.zabel

Hi Benjamin,

On Fri, 13 Dec 2019 12:02:25 +0000, Benjamin Bara - SKIDATA wrote:
> we are currently facing a problem with the i.MX6DL and MPEG4-2 encoded videos.
> The decoder seem to fail to decode videos of certain resolutions (video output becomes green).
> For the latest test run, we used Linux kernel 5.4.2 and GStreamer version 1.16.1.
> 
> When hunting the problem down, it seems like the problem is related to the YUY2 (= YUYV) output format.
> Unfortunately, gst always takes YUY2 as the default format for the v4l2mpeg4dec sink pad and 
> forcing a different format does not work (video becomes even more green).
> 
> We saw commit d40e98c13b3e7cb1aa16e9c14f35db3c8c3dd033, which added YUYV if VDOA is used,
> but could not find anything related in the i.MX 6Dual/6Quad VPU API Linux Reference Manual except:
> "One pixel value of a component occupies one byte and the frame data is in YCbCr 4:2:0 format 
> for H.264, H.264 and MPEG-4 codecs." [sic] (Rev. L3.0.35_1.1.0, 01/2013)

The VDOA is documented in the "i.MX 6Dual/6Quad Applications Processor
Reference Manual" because it is not part of the VPU IP core, but an
i.MX-specific adapter between the VPU and the IPU. It is managed by the
coda driver to provide a better abstraction to user space.

If you use a different format other than YUYV (or disable the VDOA
using the disable_vdoa module parameter), you bypass the VDOA and
directly get whatever the VPU is producing.

> 
> For debug purposes, we changed the dst_formats of the decoder driver to only support YUV420 (= I420).
> All tested resolutions are working with this setup.

Not sure if I understand correctly. Did you remove all other formats
except for YUV420 from the driver? Once you did that, all resolutions
are decoded correctly? What happens if you force the driver to produce
NV12 as destination format?

The height of the working resolutions seems to be a multiple of 16,
which is the macroblock size. Thus, there might be a problem with the
cropping the destination frames. Do you see the problems only with
videos that are encoded by the CODA or also with other mpeg4 encoded
videos?

Michael

> 
> Does anyone else face similar issues?
> 
> Please just drop me a mail if we should perform further debug actions or provide further debug output.
> 
> BR,
> Benjamin
> 
> 
> *gst-launch pipeline to reproduce the error:*
> gst-launch-1.0 -v videotestsrc ! video/x-raw,width=480,height=270 ! v4l2mpeg4enc output-io-mode=4 ! \
> 	v4l2mpeg4dec ! xvimagesink
> 
> *failing gst-launch pipeline to force the I420 format:*
> gst-launch-1.0 -v videotestsrc ! video/x-raw,width=480,height=270 ! v4l2mpeg4enc output-io-mode=4 ! \
> 	v4l2mpeg4dec ! video/x-raw,format=I420 ! xvimagesink
> 
> *some other failing resolutions:*
> - 320x200
> - 400x270
> - 400x300
> - 480x250
> - 480x270
> - 480x500
> - 640x200
> - 800x600
> 
> *working resolutions:*
> - 320x240
> - 1024x576
> - ...
> 
> *resulting dmesg output:*
> [ 6159.838070] coda 2040000.vpu: CODA_COMMAND_SEQ_INIT failed, error code = 0x1
> [ 6159.895636] coda 2040000.vpu: errors in 504 macroblocks
> [ 6159.900877] coda 2040000.vpu: decoded frame index out of range: 0
> [ 6160.963450] coda 2040000.vpu: CODA PIC_RUN timeout
> [ 6162.003422] coda 2040000.vpu: CODA PIC_RUN timeout
> 
> *verbose output of failing gst-launch pipeline (GST_DEBUG=1):*
> Setting pipeline to PAUSED ...
> Pipeline is PREROLLING ...
> /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
> /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
> /GstPipeline:pipeline0/v4l2mpeg4enc:v4l2mpeg4enc0.GstPad:src: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)5, width=(int)480, height=(int)270, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
> /GstPipeline:pipeline0/v4l2mpeg4dec:v4l2mpeg4dec0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)5, width=(int)480, height=(int)270, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
> Redistribute latency...
> /GstPipeline:pipeline0/v4l2mpeg4enc:v4l2mpeg4enc0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
> /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)480, height=(int)270, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
> /GstPipeline:pipeline0/v4l2mpeg4dec:v4l2mpeg4dec0.GstPad:src: caps = video/x-raw, format=(string)YUY2, width=(int)480, height=(int)270, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)30/1
> /GstPipeline:pipeline0/GstXvImageSink:xvimagesink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, width=(int)480, height=(int)270, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)30/1
> Pipeline is PREROLLED ...
> Setting pipeline to PLAYING ...
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [i.MX6][CODA] certain resolutions are not working in YUYV format
  2019-12-16 17:21 ` Michael Tretter
@ 2019-12-17 11:52   ` Benjamin Bara - SKIDATA
  2020-02-11  8:01     ` Benjamin Bara - SKIDATA
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Bara - SKIDATA @ 2019-12-17 11:52 UTC (permalink / raw)
  To: Michael Tretter
  Cc: linux-arm, linux-media, Richard Leitner - SKIDATA, p.zabel

Hi Michael,

thanks for your fast reply.

> Did you remove all other formats except for YUV420 from the driver? 

Exactly.

> Once you did that, all resolutions are decoded correctly?

Exactly.
But it happens very often that decoding the resolutions 320x200 and 400x300 
fails completely (see log on bottom). This occurs independent from the format in use.
However, independent from that, the decoding is correct, even on videos with a height
not divisible by 16.

> What happens if you force the driver to produce NV12 as destination format?

Artefacts appear on the top of each video with a height not divisible by 16.
The amount of incorrect pixel rows varies.
For example, with 480x500 the top 23 pixel rows and with 400x270 the top 3 pixel rows 
are "wrong".
We again removed all other formats in the driver.

> The height of the working resolutions seems to be a multiple of 16, 
> which is the macroblock size. 

We can confirm that. 
We tried a couple more heights, the problem seems to be related to that.
However, the width seems to have no influence.

> Do you see the problems only with videos that are encoded by the CODA or
> also with other mpeg4 encoded videos?

We also tried videos that are encoded with libxvid with the same outcome.


For further debugging, we also disabled the VDOA (by setting disable_vdoa=1) with the unmodified driver.
The result is exactly the same as forcing the I420 with a gst filter, as previously described.
The decoded output turns out to be completely green, also for "working resolutions".

Another finding, when modifying the driver: 
When forcing NV12, the VDOA is only enabled on the two "working resolutions" (dmesg output).
When forcing YUV420, the VDOA is always disabled (dmesg output).

BR,
Benjamin


*NV12 VDOA state log, disabled ones have artefacts*
width=1024,height=576.log:  [ 3470.252753] coda 2040000.vpu: 0: Video Data Order Adapter: Enabled
width=320,height=200.log:  [ 3447.371954] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
width=320,height=240.log:  [ 3468.941241] coda 2040000.vpu: 0: Video Data Order Adapter: Enabled
width=400,height=270.log:  [ 3453.788067] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
width=400,height=300.log:  [ 3455.110895] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
width=480,height=250.log:  [ 3461.457987] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
width=480,height=270.log:  [ 3462.803341] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
width=480,height=500.log:  [ 3464.198940] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
width=640,height=200.log:  [ 3465.745334] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
width=800,height=600.log:  [ 3467.132577] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled


*disabled VDOA results to I420 format*
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/v4l2mpeg4enc:v4l2mpeg4enc0.GstPad:src: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)5, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/v4l2mpeg4dec:v4l2mpeg4dec0.GstPad:sink: caps = video/mpeg, mpegversion=(int)4, systemstream=(boolean)false, profile=(string)simple, level=(string)5, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Redistribute latency...
/GstPipeline:pipeline0/v4l2mpeg4enc:v4l2mpeg4enc0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, interlace-mode=(string)progressive, colorimetry=(string)bt601, pixel-aspect-ratio=(fraction)1/1
/GstPipeline:pipeline0/v4l2mpeg4dec:v4l2mpeg4dec0.GstPad:src: caps = video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:sink: caps = video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)bt601, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstJpegEnc:jpegenc0.GstPad:src: caps = image/jpeg, sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
/GstPipeline:pipeline0/GstMultiFileSink:multifilesink0.GstPad:sink: caps = image/jpeg, sof-marker=(int)0, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)30/1, interlace-mode=(string)progressive, colorimetry=(string)bt601, chroma-site=(string)jpeg, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...

 
*failed 320x200 decoding (this time with NV12 format)*
  [ 3446.527178] coda 2040000.vpu: Using fallback firmware vpu/vpu_fw_imx6d.bin
  [ 3446.530688] coda 2040000.vpu: Firmware code revision: 570363
  [ 3446.530699] coda 2040000.vpu: Initialized CODA960.
  [ 3446.530704] coda 2040000.vpu: Firmware version: 3.1.1
  [ 3446.533544] coda 2040000.vpu: encoder registered as video4
  [ 3446.534523] coda 2040000.vpu: decoder registered as video5
  [ 3446.539369] coda 2040000.vpu: 0: open instance (11a120f6)
  [ 3446.539485] coda 2040000.vpu: 0: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3446.539494] coda 2040000.vpu: 0: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3446.539502] coda 2040000.vpu: 0: s_ctrl: id = 0x9909cf, name = "Video Bitrate", val = 0
  [ 3446.539509] coda 2040000.vpu: 0: s_ctrl: id = 0x9909cb, name = "Video GOP Size", val = 16
  [ 3446.539515] coda 2040000.vpu: 0: s_ctrl: id = 0x990a5e, name = "H264 I-Frame QP Value", val = 25
  [ 3446.539521] coda 2040000.vpu: 0: s_ctrl: id = 0x990a5f, name = "H264 P-Frame QP Value", val = 25
  [ 3446.539526] coda 2040000.vpu: 0: s_ctrl: id = 0x990a62, name = "H264 Maximum QP Value", val = 51
  [ 3446.539533] coda 2040000.vpu: 0: s_ctrl: id = 0x990a68, name = "H264 Loop Filter Alpha Offset", val = 0
  [ 3446.539538] coda 2040000.vpu: 0: s_ctrl: id = 0x990a69, name = "H264 Loop Filter Beta Offset", val = 0
  [ 3446.539545] coda 2040000.vpu: 0: s_ctrl: id = 0x990a6a, name = "H264 Loop Filter Mode", val = 0 ("Enabled")
  [ 3446.539551] coda 2040000.vpu: 0: s_ctrl: id = 0x990a7f, name = "H264 Constrained Intra Pred", val = 0
  [ 3446.539556] coda 2040000.vpu: 0: s_ctrl: id = 0x990a80, name = "H264 Chroma QP Index Offset", val = 0
  [ 3446.539563] coda 2040000.vpu: 0: s_ctrl: id = 0x990a6b, name = "H264 Profile", val = 0 ("Baseline")
  [ 3446.539569] coda 2040000.vpu: 0: s_ctrl: id = 0x990a67, name = "H264 Level", val = 11 ("4")
  [ 3446.539575] coda 2040000.vpu: 0: s_ctrl: id = 0x990a90, name = "MPEG4 I-Frame QP Value", val = 2
  [ 3446.539581] coda 2040000.vpu: 0: s_ctrl: id = 0x990a91, name = "MPEG4 P-Frame QP Value", val = 2
  [ 3446.539587] coda 2040000.vpu: 0: s_ctrl: id = 0x990a96, name = "MPEG4 Profile", val = 0 ("Simple")
  [ 3446.539593] coda 2040000.vpu: 0: s_ctrl: id = 0x990a95, name = "MPEG4 Level", val = 7 ("5")
  [ 3446.539599] coda 2040000.vpu: 0: s_ctrl: id = 0x9909dd, name = "Slice Partitioning Method", val = 0 ("Single")
  [ 3446.539605] coda 2040000.vpu: 0: s_ctrl: id = 0x9909dc, name = "Number of MBs in a Slice", val = 1
  [ 3446.539611] coda 2040000.vpu: 0: s_ctrl: id = 0x9909db, name = "Maximum Bytes in a Slice", val = 500
  [ 3446.539617] coda 2040000.vpu: 0: s_ctrl: id = 0x9909d8, name = "Sequence Header Mode", val = 1 ("Joined With 1st Frame")
  [ 3446.539623] coda 2040000.vpu: 0: s_ctrl: id = 0x9909d6, name = "Number of Intra Refresh MBs", val = 0
  [ 3446.539629] coda 2040000.vpu: 0: s_ctrl: id = 0x9909e1, name = "Initial Delay for VBV Control", val = 0
  [ 3446.539635] coda 2040000.vpu: 0: s_ctrl: id = 0x9909de, name = "VBV Buffer Size", val = 0
  [ 3446.540164] coda 2040000.vpu: 0: release instance (11a120f6)
  [ 3446.549095] coda 2040000.vpu: 0: open instance (11a120f6)
  [ 3446.549210] coda 2040000.vpu: 0: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3446.549226] coda 2040000.vpu: 0: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3446.549832] coda 2040000.vpu: 0: release instance (11a120f6)
  [ 3447.149581] coda 2040000.vpu: 0: open instance (11a120f6)
  [ 3447.149690] coda 2040000.vpu: 0: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3447.149699] coda 2040000.vpu: 0: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3447.149706] coda 2040000.vpu: 0: s_ctrl: id = 0x9909cf, name = "Video Bitrate", val = 0
  [ 3447.149713] coda 2040000.vpu: 0: s_ctrl: id = 0x9909cb, name = "Video GOP Size", val = 16
  [ 3447.149720] coda 2040000.vpu: 0: s_ctrl: id = 0x990a5e, name = "H264 I-Frame QP Value", val = 25
  [ 3447.149726] coda 2040000.vpu: 0: s_ctrl: id = 0x990a5f, name = "H264 P-Frame QP Value", val = 25
  [ 3447.149731] coda 2040000.vpu: 0: s_ctrl: id = 0x990a62, name = "H264 Maximum QP Value", val = 51
  [ 3447.149737] coda 2040000.vpu: 0: s_ctrl: id = 0x990a68, name = "H264 Loop Filter Alpha Offset", val = 0
  [ 3447.149743] coda 2040000.vpu: 0: s_ctrl: id = 0x990a69, name = "H264 Loop Filter Beta Offset", val = 0
  [ 3447.149750] coda 2040000.vpu: 0: s_ctrl: id = 0x990a6a, name = "H264 Loop Filter Mode", val = 0 ("Enabled")
  [ 3447.149756] coda 2040000.vpu: 0: s_ctrl: id = 0x990a7f, name = "H264 Constrained Intra Pred", val = 0
  [ 3447.149761] coda 2040000.vpu: 0: s_ctrl: id = 0x990a80, name = "H264 Chroma QP Index Offset", val = 0
  [ 3447.149768] coda 2040000.vpu: 0: s_ctrl: id = 0x990a6b, name = "H264 Profile", val = 0 ("Baseline")
  [ 3447.149774] coda 2040000.vpu: 0: s_ctrl: id = 0x990a67, name = "H264 Level", val = 11 ("4")
  [ 3447.149780] coda 2040000.vpu: 0: s_ctrl: id = 0x990a90, name = "MPEG4 I-Frame QP Value", val = 2
  [ 3447.149785] coda 2040000.vpu: 0: s_ctrl: id = 0x990a91, name = "MPEG4 P-Frame QP Value", val = 2
  [ 3447.149791] coda 2040000.vpu: 0: s_ctrl: id = 0x990a96, name = "MPEG4 Profile", val = 0 ("Simple")
  [ 3447.149797] coda 2040000.vpu: 0: s_ctrl: id = 0x990a95, name = "MPEG4 Level", val = 7 ("5")
  [ 3447.149804] coda 2040000.vpu: 0: s_ctrl: id = 0x9909dd, name = "Slice Partitioning Method", val = 0 ("Single")
  [ 3447.149809] coda 2040000.vpu: 0: s_ctrl: id = 0x9909dc, name = "Number of MBs in a Slice", val = 1
  [ 3447.149815] coda 2040000.vpu: 0: s_ctrl: id = 0x9909db, name = "Maximum Bytes in a Slice", val = 500
  [ 3447.149821] coda 2040000.vpu: 0: s_ctrl: id = 0x9909d8, name = "Sequence Header Mode", val = 1 ("Joined With 1st Frame")
  [ 3447.149827] coda 2040000.vpu: 0: s_ctrl: id = 0x9909d6, name = "Number of Intra Refresh MBs", val = 0
  [ 3447.149833] coda 2040000.vpu: 0: s_ctrl: id = 0x9909e1, name = "Initial Delay for VBV Control", val = 0
  [ 3447.149839] coda 2040000.vpu: 0: s_ctrl: id = 0x9909de, name = "VBV Buffer Size", val = 0
  [ 3447.155934] coda 2040000.vpu: 0: release instance (11a120f6)
  [ 3447.156186] coda 2040000.vpu: 0: open instance (11a120f6)
  [ 3447.156254] coda 2040000.vpu: 0: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3447.156263] coda 2040000.vpu: 0: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3447.157910] coda 2040000.vpu: 0: release instance (11a120f6)
  [ 3447.309740] coda 2040000.vpu: 0: open instance (205d8a8f)
  [ 3447.309848] coda 2040000.vpu: 0: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3447.309856] coda 2040000.vpu: 0: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3447.309863] coda 2040000.vpu: 0: s_ctrl: id = 0x9909cf, name = "Video Bitrate", val = 0
  [ 3447.309870] coda 2040000.vpu: 0: s_ctrl: id = 0x9909cb, name = "Video GOP Size", val = 16
  [ 3447.309876] coda 2040000.vpu: 0: s_ctrl: id = 0x990a5e, name = "H264 I-Frame QP Value", val = 25
  [ 3447.309882] coda 2040000.vpu: 0: s_ctrl: id = 0x990a5f, name = "H264 P-Frame QP Value", val = 25
  [ 3447.309887] coda 2040000.vpu: 0: s_ctrl: id = 0x990a62, name = "H264 Maximum QP Value", val = 51
  [ 3447.309893] coda 2040000.vpu: 0: s_ctrl: id = 0x990a68, name = "H264 Loop Filter Alpha Offset", val = 0
  [ 3447.309899] coda 2040000.vpu: 0: s_ctrl: id = 0x990a69, name = "H264 Loop Filter Beta Offset", val = 0
  [ 3447.309906] coda 2040000.vpu: 0: s_ctrl: id = 0x990a6a, name = "H264 Loop Filter Mode", val = 0 ("Enabled")
  [ 3447.309912] coda 2040000.vpu: 0: s_ctrl: id = 0x990a7f, name = "H264 Constrained Intra Pred", val = 0
  [ 3447.309917] coda 2040000.vpu: 0: s_ctrl: id = 0x990a80, name = "H264 Chroma QP Index Offset", val = 0
  [ 3447.309924] coda 2040000.vpu: 0: s_ctrl: id = 0x990a6b, name = "H264 Profile", val = 0 ("Baseline")
  [ 3447.309930] coda 2040000.vpu: 0: s_ctrl: id = 0x990a67, name = "H264 Level", val = 11 ("4")
  [ 3447.309936] coda 2040000.vpu: 0: s_ctrl: id = 0x990a90, name = "MPEG4 I-Frame QP Value", val = 2
  [ 3447.309941] coda 2040000.vpu: 0: s_ctrl: id = 0x990a91, name = "MPEG4 P-Frame QP Value", val = 2
  [ 3447.309947] coda 2040000.vpu: 0: s_ctrl: id = 0x990a96, name = "MPEG4 Profile", val = 0 ("Simple")
  [ 3447.309953] coda 2040000.vpu: 0: s_ctrl: id = 0x990a95, name = "MPEG4 Level", val = 7 ("5")
  [ 3447.309959] coda 2040000.vpu: 0: s_ctrl: id = 0x9909dd, name = "Slice Partitioning Method", val = 0 ("Single")
  [ 3447.309965] coda 2040000.vpu: 0: s_ctrl: id = 0x9909dc, name = "Number of MBs in a Slice", val = 1
  [ 3447.309970] coda 2040000.vpu: 0: s_ctrl: id = 0x9909db, name = "Maximum Bytes in a Slice", val = 500
  [ 3447.309977] coda 2040000.vpu: 0: s_ctrl: id = 0x9909d8, name = "Sequence Header Mode", val = 1 ("Joined With 1st Frame")
  [ 3447.309983] coda 2040000.vpu: 0: s_ctrl: id = 0x9909d6, name = "Number of Intra Refresh MBs", val = 0
  [ 3447.309989] coda 2040000.vpu: 0: s_ctrl: id = 0x9909e1, name = "Initial Delay for VBV Control", val = 0
  [ 3447.309994] coda 2040000.vpu: 0: s_ctrl: id = 0x9909de, name = "VBV Buffer Size", val = 0
  [ 3447.315188] coda 2040000.vpu: 0: release instance (205d8a8f)
  [ 3447.316311] coda 2040000.vpu: 0: open instance (11a120f6)
  [ 3447.316387] coda 2040000.vpu: 0: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3447.316396] coda 2040000.vpu: 0: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3447.316917] coda 2040000.vpu: 0: release instance (11a120f6)
  [ 3447.329495] coda 2040000.vpu: 0: open instance (11a120f6)
  [ 3447.329565] coda 2040000.vpu: 0: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3447.329573] coda 2040000.vpu: 0: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3447.330165] coda 2040000.vpu: 1: open instance (c8a897db)
  [ 3447.330252] coda 2040000.vpu: 1: s_ctrl: id = 0x980914, name = "Horizontal Flip", val = 0
  [ 3447.330260] coda 2040000.vpu: 1: s_ctrl: id = 0x980915, name = "Vertical Flip", val = 0
  [ 3447.330267] coda 2040000.vpu: 1: s_ctrl: id = 0x9909cf, name = "Video Bitrate", val = 0
  [ 3447.330274] coda 2040000.vpu: 1: s_ctrl: id = 0x9909cb, name = "Video GOP Size", val = 16
  [ 3447.330280] coda 2040000.vpu: 1: s_ctrl: id = 0x990a5e, name = "H264 I-Frame QP Value", val = 25
  [ 3447.330286] coda 2040000.vpu: 1: s_ctrl: id = 0x990a5f, name = "H264 P-Frame QP Value", val = 25
  [ 3447.330292] coda 2040000.vpu: 1: s_ctrl: id = 0x990a62, name = "H264 Maximum QP Value", val = 51
  [ 3447.330298] coda 2040000.vpu: 1: s_ctrl: id = 0x990a68, name = "H264 Loop Filter Alpha Offset", val = 0
  [ 3447.330303] coda 2040000.vpu: 1: s_ctrl: id = 0x990a69, name = "H264 Loop Filter Beta Offset", val = 0
  [ 3447.330310] coda 2040000.vpu: 1: s_ctrl: id = 0x990a6a, name = "H264 Loop Filter Mode", val = 0 ("Enabled")
  [ 3447.330316] coda 2040000.vpu: 1: s_ctrl: id = 0x990a7f, name = "H264 Constrained Intra Pred", val = 0
  [ 3447.330322] coda 2040000.vpu: 1: s_ctrl: id = 0x990a80, name = "H264 Chroma QP Index Offset", val = 0
  [ 3447.330328] coda 2040000.vpu: 1: s_ctrl: id = 0x990a6b, name = "H264 Profile", val = 0 ("Baseline")
  [ 3447.330334] coda 2040000.vpu: 1: s_ctrl: id = 0x990a67, name = "H264 Level", val = 11 ("4")
  [ 3447.330340] coda 2040000.vpu: 1: s_ctrl: id = 0x990a90, name = "MPEG4 I-Frame QP Value", val = 2
  [ 3447.330346] coda 2040000.vpu: 1: s_ctrl: id = 0x990a91, name = "MPEG4 P-Frame QP Value", val = 2
  [ 3447.330352] coda 2040000.vpu: 1: s_ctrl: id = 0x990a96, name = "MPEG4 Profile", val = 0 ("Simple")
  [ 3447.330358] coda 2040000.vpu: 1: s_ctrl: id = 0x990a95, name = "MPEG4 Level", val = 7 ("5")
  [ 3447.330364] coda 2040000.vpu: 1: s_ctrl: id = 0x9909dd, name = "Slice Partitioning Method", val = 0 ("Single")
  [ 3447.330370] coda 2040000.vpu: 1: s_ctrl: id = 0x9909dc, name = "Number of MBs in a Slice", val = 1
  [ 3447.330375] coda 2040000.vpu: 1: s_ctrl: id = 0x9909db, name = "Maximum Bytes in a Slice", val = 500
  [ 3447.330382] coda 2040000.vpu: 1: s_ctrl: id = 0x9909d8, name = "Sequence Header Mode", val = 1 ("Joined With 1st Frame")
  [ 3447.330387] coda 2040000.vpu: 1: s_ctrl: id = 0x9909d6, name = "Number of Intra Refresh MBs", val = 0
  [ 3447.330393] coda 2040000.vpu: 1: s_ctrl: id = 0x9909e1, name = "Initial Delay for VBV Control", val = 0
  [ 3447.330399] coda 2040000.vpu: 1: s_ctrl: id = 0x9909de, name = "VBV Buffer Size", val = 0
  [ 3447.338565] coda 2040000.vpu: 0: Setting vid-out format, wxh: 320x200, fmt: MPG4 L
  [ 3447.338581] coda 2040000.vpu: 0: Setting vid-cap format, wxh: 320x200, fmt: NV12 T
  [ 3447.340112] coda 2040000.vpu: 1: Setting vid-cap format, wxh: 320x200, fmt: MPG4 L
  [ 3447.341558] coda 2040000.vpu: 1: Setting vid-out format, wxh: 320x200, fmt: YU12 L
  [ 3447.343192] coda 2040000.vpu: 1: get 2 buffer(s) of size 96000 each.
  [ 3447.355307] coda 2040000.vpu: 1: get 4 buffer(s) of size 131072 each.
  [ 3447.359470] coda 2040000.vpu: 1: start streaming vid-cap
  [ 3447.360096] coda 2040000.vpu: 1: start streaming vid-out
  [ 3447.364167] coda 2040000.vpu: 1: start encoding 320x200 YU12->MPG4 @ 30/1 Hz
  [ 3447.364649] coda 2040000.vpu: 1: job ready
  [ 3447.364683] coda 2040000.vpu: 1: parameter change: intra Qp 25
  [ 3447.364689] coda 2040000.vpu: 1: parameter change: bitrate 0 kbit/s
  [ 3447.364694] coda 2040000.vpu: 1: parameter change: frame rate 30/1 Hz
  [ 3447.364699] coda 2040000.vpu: 1: parameter change: intra refresh MBs 0
  [ 3447.366167] coda 2040000.vpu: 1: frame size = 8970
  [ 3447.366185] coda 2040000.vpu: 1: job finished: encoded I frame (0)
  [ 3447.367206] coda 2040000.vpu: 0: get 2 buffer(s) of size 131072 each.
  [ 3447.370479] coda 2040000.vpu: 1: job ready
  [ 3447.370833] coda 2040000.vpu: 0: start streaming vid-out
  [ 3447.371921] coda 2040000.vpu: 1: frame size = 6048
  [ 3447.371934] coda 2040000.vpu: 1: job finished: encoded P frame (1)
  [ 3447.371954] coda 2040000.vpu: 0: Video Data Order Adapter: Disabled
  [ 3447.372105] coda 2040000.vpu: CODA_COMMAND_SEQ_INIT failed, error code = 0x4
  [ 3447.380404] coda 2040000.vpu: 1: job ready
  [ 3447.381651] coda 2040000.vpu: 0: Setting vid-cap format, wxh: 320x200, fmt: NV12 T
  [ 3447.383805] coda 2040000.vpu: 0: get 3 buffer(s) of size 96000 each.
  [ 3447.384828] coda 2040000.vpu: 1: frame size = 5957
  [ 3447.384853] coda 2040000.vpu: 1: job finished: encoded P frame (2)
  [ 3447.387027] coda 2040000.vpu: 1: job ready
  [ 3447.388486] coda 2040000.vpu: 0: start streaming vid-cap
  [ 3447.388493] coda 2040000.vpu: 1: frame size = 6027
  [ 3447.388507] coda 2040000.vpu: 1: job finished: encoded P frame (3)
  [ 3447.389010] coda 2040000.vpu: 0: not ready: need 2 buffers available (queue:1 + bitstream:0)
  [ 3447.389839] coda 2040000.vpu: 0: job ready
  [ 3447.391311] coda 2040000.vpu: 1: job ready
  [ 3447.400762] coda 2040000.vpu: errors in 254 macroblocks
  [ 3447.405999] coda 2040000.vpu: decoded frame index out of range: 0
  [ 3447.412254] coda 2040000.vpu: 0: job finished: no frame decoded (0) or returned (-1)
  [ 3447.412269] coda 2040000.vpu: 0: job ready
  [ 3447.413677] coda 2040000.vpu: 1: frame size = 6016
  [ 3447.416004] coda 2040000.vpu: 1: job finished: encoded P frame (4)
  [ 3447.416015] coda 2040000.vpu: 1: job ready
  [ 3448.486249] coda 2040000.vpu: CODA PIC_RUN timeout
  [ 3448.491089] coda 2040000.vpu: 0: not ready: on hold for more buffers.
  [ 3448.492545] coda 2040000.vpu: 1: frame size = 6143
  [ 3448.496929] coda 2040000.vpu: 0: job ready
  [ 3448.497205] coda 2040000.vpu: 1: job finished: encoded ? frame (0)
  [ 3448.497225] coda 2040000.vpu: 1: job ready
  [ 3449.526215] coda 2040000.vpu: CODA PIC_RUN timeout
  [ 3449.531052] coda 2040000.vpu: 0: not ready: on hold for more buffers.
  [ 3449.532503] coda 2040000.vpu: 1: frame size = 5996
  [ 3449.533163] coda 2040000.vpu: 0: job ready
  [ 3449.533391] coda 2040000.vpu: 1: job finished: encoded ? frame (0)
  [ 3449.533408] coda 2040000.vpu: 1: job ready
  [ 3450.566215] coda 2040000.vpu: CODA PIC_RUN timeout
  [ 3450.571062] coda 2040000.vpu: 0: not ready: on hold for more buffers.
  [ 3450.572531] coda 2040000.vpu: 1: frame size = 6141
  [ 3450.573251] coda 2040000.vpu: 0: job ready
  [ 3450.573488] coda 2040000.vpu: 1: job finished: encoded ? frame (0)
  [ 3450.573504] coda 2040000.vpu: 1: job ready
  [ 3451.606228] coda 2040000.vpu: CODA PIC_RUN timeout
  [ 3451.611071] coda 2040000.vpu: 0: not ready: on hold for more buffers.
  [ 3451.612525] coda 2040000.vpu: 1: frame size = 6039
  [ 3451.613005] coda 2040000.vpu: 1: job finished: encoded P frame (8)
  [ 3451.613027] coda 2040000.vpu: 1: job ready
  [ 3451.613354] coda 2040000.vpu: 0: job ready
  [ 3451.615012] coda 2040000.vpu: 1: frame size = 6137
  [ 3451.615779] coda 2040000.vpu: 1: job finished: encoded ? frame (0)
  [ 3451.617103] coda 2040000.vpu: 0: marking last meta
  [ 3451.617117] coda 2040000.vpu: 0: all remaining buffers queued
  [ 3452.646240] coda 2040000.vpu: CODA PIC_RUN timeout
  [ 3452.651332] coda 2040000.vpu: 0: not ready: on hold for more buffers.
  [ 3452.659515] coda 2040000.vpu: 0: stop streaming vid-out
  [ 3452.659623] coda 2040000.vpu: 0: coda_seq_end_work: sent command 'SEQ_END' to coda
  [ 3452.660617] coda 2040000.vpu: 0: stop streaming vid-cap
  [ 3452.661567] coda 2040000.vpu: 1: stop streaming vid-out
  [ 3452.661642] coda 2040000.vpu: 1: coda_seq_end_work: sent command 'SEQ_END' to coda
  [ 3452.662671] coda 2040000.vpu: 1: stop streaming vid-cap
  [ 3452.665111] coda 2040000.vpu: 0: release instance (11a120f6)
  [ 3452.665563] coda 2040000.vpu: 1: release instance (c8a897db)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [i.MX6][CODA] certain resolutions are not working in YUYV format
  2019-12-17 11:52   ` Benjamin Bara - SKIDATA
@ 2020-02-11  8:01     ` Benjamin Bara - SKIDATA
  2020-02-26 16:22       ` Michael Tretter
  0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Bara - SKIDATA @ 2020-02-11  8:01 UTC (permalink / raw)
  To: Michael Tretter; +Cc: linux-arm, linux-media, Richard Leitner - SKIDATA

Hey Michael,

any news from your side?
We did some further testing with MPEG4-2 videos and the new 5.5 kernel.

Summary:
1.) decoding of videos with a height not divisible by 16 (macroblock size) brings erroneous pixels/fragments in the top area.
2.) decoding of videos with BVOP2 (2 B-Frames) [a] results in macroblock errors [1].
3.) decoding of "static" videos with low bitrates and a GoP size > 1 results in timeouts [2].
4.) encoded videos with low bitrates and GoP size > 1 show ffmpeg errors [3] during re-encoding with a different tag (in software) [b].

ad 1.)
When running [c], the fragments are not shown.
But when the stream is stored in a file and then played (as in [d]), some of the top pixel rows are erroneous.
These fragments also occur on other videos, encoded with different software libraries.

ad 3.)
This is especially the case if the video is static and the size of a P-frame packet is low.
Can e.g. be reproduced with [e], but also happens during decoding with in software encoded videos with similar attributes.
The size of a P-frame packet of such a video is around 94 bytes. Is it possible that there is a limitation regarding minimum packet size?

ad 4.)
Did [b] with a bitrate from 100k to 2M in 25k steps and a GoP size from 1 to 16.
The following combinations result in at least P-frame errors. Some also contain I-frame errors, as can be seen in [3]:
100k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
125k: 4, 5, 7, 8, 9, 10, 13, 14, 15
150k: 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
175k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
200k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
225k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
250k: 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
275k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
300k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
325k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
350k: 2, 3, 4, 6, 7, 8, 9, 10
375k: 2, 3, 4, 5, 6, 7, 8, 10
400k: 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15, 16
425k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16
450k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
475k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15
500k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
525k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16

GoP size of 1 did not show any errors.

=> Point 3.) and 4.) might be related?

Also noticeable: The expected/configured bitrate strongly varies from the detected bitrate.


If you need further info or if we should take further actions, just drop us a mail.

thanks & br,
Benjamin


[a]
# create video
gst-launch-1.0 videotestsrc num-buffers=200 ! video/x-raw,width=270,height=480 ! v4l2mpeg4enc output-io-mode=4 ! avimux ! filesink location=/tmp/input.avi

# re-encode in software: SP@L1 w/ BVOP2
ffmpeg -i /tmp/input.avi -c:v mpeg4 -vtag XVID -profile:v 0 -level 1 -bf 2 /tmp/output.avi

# re-encode in software: ASP@L5 w/ BVOP2
ffmpeg -i /tmp/input.avi -c:v mpeg4 -vtag XVID -profile:v 15 -level 5 -bf 2 /tmp/output.avi

# play
gst-launch-1.0 playbin uri=file:///tmp/output.avi
================================================================
[b]
# create video
gst-launch-1.0 videotestsrc num-buffers=200 ! video/x-raw,width=270,height=480 ! v4l2mpeg4enc output-io-mode=4 extra-controls="c,video_gop_size=11,video_bitrate=100000" ! avimux ! filesink location=divx/test_100000_11.avi

# re-encode it in software with different tag
ffmpeg -i divx/test_100000_11.avi -vtag "XVID" xvid/test_100000_11.avi
================================================================
[c]
# directly insert the encoded stream into the decoder
gst-launch-1.0 videotestsrc ! video/x-raw,width=480,height=360 ! v4l2mpeg4enc output-io-mode=4 ! v4l2mpeg4dec ! videoconvert ! ximagesink
================================================================
[d]
# store in avi file
gst-launch-1.0 videotestsrc num-buffers=200 ! video/x-raw,width=270,height=480 ! v4l2mpeg4enc output-io-mode=4 ! avimux ! filesink location=/tmp/input.avi

# convert tag in software, since gstreamer decoder plugin doesn't take DIVX tag but avimux plugin forces it
ffmpeg -i /tmp/input.avi -vtag "XVID" /tmp/output.avi

# play it
gst-launch-1.0 playbin uri=file:///tmp/output.avi
================================================================
[e]
# run a static video and try to encode, decode and then play it
gst-launch-1.0 videotestsrc num-buffers=200 pattern=blue ! video/x-raw,width=480,height=360 ! v4l2mpeg4enc output-io-mode=4 ! v4l2mpeg4dec ! videoconvert ! ximagesink
================================================================
================================================================
[1]
[853909.824215] coda 2040000.vpu: errors in 6 macroblocks
[853909.832120] coda 2040000.vpu: errors in 6 macroblocks
[853909.845459] coda 2040000.vpu: errors in 27 macroblocks
[853909.854856] coda 2040000.vpu: errors in 27 macroblocks
[853909.901550] coda 2040000.vpu: errors in 303 macroblocks
[853909.908588] coda 2040000.vpu: errors in 303 macroblocks
================================================================
[2]
[441877.923839] coda 2040000.vpu: CODA PIC_RUN timeout
[441878.963854] coda 2040000.vpu: CODA PIC_RUN timeout
[441880.003842] coda 2040000.vpu: CODA PIC_RUN timeout
[441881.043854] coda 2040000.vpu: CODA PIC_RUN timeout
[441882.093818] coda 2040000.vpu: CODA PIC_RUN timeout
[441883.123883] coda 2040000.vpu: CODA PIC_RUN timeout
[441884.173863] coda 2040000.vpu: CODA PIC_RUN timeout
[441885.203834] coda 2040000.vpu: CODA PIC_RUN timeout
================================================================
[3]
Input #0, avi, from 'divx/test_100000_11.avi':
  Duration: 00:00:06.67, start: 0.000000, bitrate: 902 kb/s
    Stream #0:0: Video: mpeg4 (Simple Profile) (DIVX / 0x58564944), yuv420p, 270x480 [SAR 1:1 DAR 9:16], 899 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mpeg4 (native) -> mpeg4 (native))
Press [q] to stop, [?] for help
[mpeg4 @ 0x5649b529bfc0] Error at MB: 360
[mpeg4 @ 0x5649b529bfc0] concealing 227 DC, 227 AC, 227 MV errors in P frame
Output #0, avi, to 'xvid/test_100000_11.avi':
  Metadata:
    ISFT            : Lavf58.20.100
    Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 270x480 [SAR 1:1 DAR 9:16], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
    Metadata:
      encoder         : Lavc58.35.100 mpeg4
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
[mpeg4 @ 0x5649b529bfc0] slice end not reached but screenspace end (47 left 7E01DC, score= -6)
[mpeg4 @ 0x5649b529bfc0] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b52b2a80] slice end not reached but screenspace end (45 left 780321, score= -25)
[mpeg4 @ 0x5649b52b2a80] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b5295a00] slice end not reached but screenspace end (44 left 700DE7, score= -46)
[mpeg4 @ 0x5649b5295a00] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b529bfc0] slice end not reached but screenspace end (43 left 6796F1, score= -56)
[mpeg4 @ 0x5649b529bfc0] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b5297c40] slice end not reached but screenspace end (48 left 7F1AE9, score= -65)
[mpeg4 @ 0x5649b5297c40] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b52b2a80] slice end not reached but screenspace end (47 left 7E0095, score= -74)
[mpeg4 @ 0x5649b52b2a80] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b529bfc0] slice end not reached but screenspace end (42 left 400392, score= -102)
[mpeg4 @ 0x5649b529bfc0] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b5297c40] slice end not reached but screenspace end (46 left 7C0283, score= -164)
[mpeg4 @ 0x5649b5297c40] concealing 510 DC, 510 AC, 510 MV errors in I frame
[mpeg4 @ 0x5649b52b2a80] slice end not reached but screenspace end (42 left 68845C, score= -174)
[mpeg4 @ 0x5649b52b2a80] concealing 510 DC, 510 AC, 510 MV errors in I frame
frame=  200 fps=0.0 q=31.0 Lsize=     477kB time=00:00:06.66 bitrate= 586.2kbits/s speed=50.7x    
video:467kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.229403%


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [i.MX6][CODA] certain resolutions are not working in YUYV format
  2020-02-11  8:01     ` Benjamin Bara - SKIDATA
@ 2020-02-26 16:22       ` Michael Tretter
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Tretter @ 2020-02-26 16:22 UTC (permalink / raw)
  To: Benjamin Bara - SKIDATA; +Cc: linux-arm, linux-media, Richard Leitner - SKIDATA

Hi Benjamin,

On Tue, 11 Feb 2020 08:01:29 +0000, Benjamin Bara - SKIDATA wrote:
> any news from your side?
> We did some further testing with MPEG4-2 videos and the new 5.5 kernel.

The H.264 encoding and decoding is much better tested than the MPEG4-2
encoder and decoder. Thus, it might be worth to check the driver for
any H.264 specific code and see if you need the code for MPEG4 as well.

> 
> Summary:
> 1.) decoding of videos with a height not divisible by 16 (macroblock size) brings erroneous pixels/fragments in the top area.

The decoder only works on macroblocks. For h.264 the driver rounds the
size to 16, adds some padding and crops the output. You probably have
to enable the code for MPEG4 as well.

> 2.) decoding of videos with BVOP2 (2 B-Frames) [a] results in macroblock errors [1].

No idea about that one.

> 3.) decoding of "static" videos with low bitrates and a GoP size > 1 results in timeouts [2].

There is a minimum amount of data that the decoder needs to start
decoding. For H.264, we feed some padding data to the decoder to make
it start. Probably something similar must be done for MPEG4, too.

> 4.) encoded videos with low bitrates and GoP size > 1 show ffmpeg errors [3] during re-encoding with a different tag (in software) [b].

Maybe this is related to 3.), but I'm not sure. Does just decoding the
videos without re-encoding work without errors?

Michael

> 
> ad 1.)
> When running [c], the fragments are not shown.
> But when the stream is stored in a file and then played (as in [d]), some of the top pixel rows are erroneous.
> These fragments also occur on other videos, encoded with different software libraries.
> 
> ad 3.)
> This is especially the case if the video is static and the size of a P-frame packet is low.
> Can e.g. be reproduced with [e], but also happens during decoding with in software encoded videos with similar attributes.
> The size of a P-frame packet of such a video is around 94 bytes. Is it possible that there is a limitation regarding minimum packet size?
> 
> ad 4.)
> Did [b] with a bitrate from 100k to 2M in 25k steps and a GoP size from 1 to 16.
> The following combinations result in at least P-frame errors. Some also contain I-frame errors, as can be seen in [3]:
> 100k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 125k: 4, 5, 7, 8, 9, 10, 13, 14, 15
> 150k: 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 175k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 200k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 225k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 250k: 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 275k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 300k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 325k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 350k: 2, 3, 4, 6, 7, 8, 9, 10
> 375k: 2, 3, 4, 5, 6, 7, 8, 10
> 400k: 2, 3, 4, 5, 6, 7, 9, 10, 11, 13, 15, 16
> 425k: 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16
> 450k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 475k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15
> 500k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
> 525k: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 16
> 
> GoP size of 1 did not show any errors.
> 
> => Point 3.) and 4.) might be related?  
> 
> Also noticeable: The expected/configured bitrate strongly varies from the detected bitrate.
> 
> 
> If you need further info or if we should take further actions, just drop us a mail.
> 
> thanks & br,
> Benjamin
> 
> 
> [a]
> # create video
> gst-launch-1.0 videotestsrc num-buffers=200 ! video/x-raw,width=270,height=480 ! v4l2mpeg4enc output-io-mode=4 ! avimux ! filesink location=/tmp/input.avi
> 
> # re-encode in software: SP@L1 w/ BVOP2
> ffmpeg -i /tmp/input.avi -c:v mpeg4 -vtag XVID -profile:v 0 -level 1 -bf 2 /tmp/output.avi
> 
> # re-encode in software: ASP@L5 w/ BVOP2
> ffmpeg -i /tmp/input.avi -c:v mpeg4 -vtag XVID -profile:v 15 -level 5 -bf 2 /tmp/output.avi
> 
> # play
> gst-launch-1.0 playbin uri=file:///tmp/output.avi
> ================================================================
> [b]
> # create video
> gst-launch-1.0 videotestsrc num-buffers=200 ! video/x-raw,width=270,height=480 ! v4l2mpeg4enc output-io-mode=4 extra-controls="c,video_gop_size=11,video_bitrate=100000" ! avimux ! filesink location=divx/test_100000_11.avi
> 
> # re-encode it in software with different tag
> ffmpeg -i divx/test_100000_11.avi -vtag "XVID" xvid/test_100000_11.avi
> ================================================================
> [c]
> # directly insert the encoded stream into the decoder
> gst-launch-1.0 videotestsrc ! video/x-raw,width=480,height=360 ! v4l2mpeg4enc output-io-mode=4 ! v4l2mpeg4dec ! videoconvert ! ximagesink
> ================================================================
> [d]
> # store in avi file
> gst-launch-1.0 videotestsrc num-buffers=200 ! video/x-raw,width=270,height=480 ! v4l2mpeg4enc output-io-mode=4 ! avimux ! filesink location=/tmp/input.avi
> 
> # convert tag in software, since gstreamer decoder plugin doesn't take DIVX tag but avimux plugin forces it
> ffmpeg -i /tmp/input.avi -vtag "XVID" /tmp/output.avi
> 
> # play it
> gst-launch-1.0 playbin uri=file:///tmp/output.avi
> ================================================================
> [e]
> # run a static video and try to encode, decode and then play it
> gst-launch-1.0 videotestsrc num-buffers=200 pattern=blue ! video/x-raw,width=480,height=360 ! v4l2mpeg4enc output-io-mode=4 ! v4l2mpeg4dec ! videoconvert ! ximagesink
> ================================================================
> ================================================================
> [1]
> [853909.824215] coda 2040000.vpu: errors in 6 macroblocks
> [853909.832120] coda 2040000.vpu: errors in 6 macroblocks
> [853909.845459] coda 2040000.vpu: errors in 27 macroblocks
> [853909.854856] coda 2040000.vpu: errors in 27 macroblocks
> [853909.901550] coda 2040000.vpu: errors in 303 macroblocks
> [853909.908588] coda 2040000.vpu: errors in 303 macroblocks
> ================================================================
> [2]
> [441877.923839] coda 2040000.vpu: CODA PIC_RUN timeout
> [441878.963854] coda 2040000.vpu: CODA PIC_RUN timeout
> [441880.003842] coda 2040000.vpu: CODA PIC_RUN timeout
> [441881.043854] coda 2040000.vpu: CODA PIC_RUN timeout
> [441882.093818] coda 2040000.vpu: CODA PIC_RUN timeout
> [441883.123883] coda 2040000.vpu: CODA PIC_RUN timeout
> [441884.173863] coda 2040000.vpu: CODA PIC_RUN timeout
> [441885.203834] coda 2040000.vpu: CODA PIC_RUN timeout
> ================================================================
> [3]
> Input #0, avi, from 'divx/test_100000_11.avi':
>   Duration: 00:00:06.67, start: 0.000000, bitrate: 902 kb/s
>     Stream #0:0: Video: mpeg4 (Simple Profile) (DIVX / 0x58564944), yuv420p, 270x480 [SAR 1:1 DAR 9:16], 899 kb/s, 30 fps, 30 tbr, 30 tbn, 30 tbc
> Stream mapping:
>   Stream #0:0 -> #0:0 (mpeg4 (native) -> mpeg4 (native))
> Press [q] to stop, [?] for help
> [mpeg4 @ 0x5649b529bfc0] Error at MB: 360
> [mpeg4 @ 0x5649b529bfc0] concealing 227 DC, 227 AC, 227 MV errors in P frame
> Output #0, avi, to 'xvid/test_100000_11.avi':
>   Metadata:
>     ISFT            : Lavf58.20.100
>     Stream #0:0: Video: mpeg4 (XVID / 0x44495658), yuv420p, 270x480 [SAR 1:1 DAR 9:16], q=2-31, 200 kb/s, 30 fps, 30 tbn, 30 tbc
>     Metadata:
>       encoder         : Lavc58.35.100 mpeg4
>     Side data:
>       cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
> [mpeg4 @ 0x5649b529bfc0] slice end not reached but screenspace end (47 left 7E01DC, score= -6)
> [mpeg4 @ 0x5649b529bfc0] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b52b2a80] slice end not reached but screenspace end (45 left 780321, score= -25)
> [mpeg4 @ 0x5649b52b2a80] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b5295a00] slice end not reached but screenspace end (44 left 700DE7, score= -46)
> [mpeg4 @ 0x5649b5295a00] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b529bfc0] slice end not reached but screenspace end (43 left 6796F1, score= -56)
> [mpeg4 @ 0x5649b529bfc0] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b5297c40] slice end not reached but screenspace end (48 left 7F1AE9, score= -65)
> [mpeg4 @ 0x5649b5297c40] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b52b2a80] slice end not reached but screenspace end (47 left 7E0095, score= -74)
> [mpeg4 @ 0x5649b52b2a80] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b529bfc0] slice end not reached but screenspace end (42 left 400392, score= -102)
> [mpeg4 @ 0x5649b529bfc0] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b5297c40] slice end not reached but screenspace end (46 left 7C0283, score= -164)
> [mpeg4 @ 0x5649b5297c40] concealing 510 DC, 510 AC, 510 MV errors in I frame
> [mpeg4 @ 0x5649b52b2a80] slice end not reached but screenspace end (42 left 68845C, score= -174)
> [mpeg4 @ 0x5649b52b2a80] concealing 510 DC, 510 AC, 510 MV errors in I frame
> frame=  200 fps=0.0 q=31.0 Lsize=     477kB time=00:00:06.66 bitrate= 586.2kbits/s speed=50.7x    
> video:467kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.229403%
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-02-26 16:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 12:02 [i.MX6][CODA] certain resolutions are not working in YUYV format Benjamin Bara - SKIDATA
2019-12-16 17:21 ` Michael Tretter
2019-12-17 11:52   ` Benjamin Bara - SKIDATA
2020-02-11  8:01     ` Benjamin Bara - SKIDATA
2020-02-26 16:22       ` Michael Tretter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).