Artifact w/ HW decode i.MX6

there seem to be some artifacts on the screen during the decode. Sample is here, the issue is a grey bar at the bottom on the video, this is not present during a SW decode or on VDPAU.

Unique ID                                : 244043958016963078675602115081842977901 (0xB799281A28E0E372B164F0B2E393EC6D)
Complete name                            : grey_bar.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 20.0 MiB
Duration                                 : 2h 10mn
Overall bit rate                         : 21.5 Kbps
Movie name                               : Fast
Encoded date                             : UTC 2013-07-03 22:00:05
Writing application                      : mkvmerge v5.3.0 ('I could have danced') built on Feb  9 2012 10:38:07
Writing library                          : libebml v1.2.3 + libmatroska v1.3.0

ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : Main@L3.1
Format settings, CABAC                   : No
Format settings, ReFrames                : 2 frames
Muxing mode                              : Header stripping
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 2h 10mn
Width                                    : 1 280 pixels
Height                                   : 542 pixels
Display aspect ratio                     : 2.35:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Title                                    : Fast
Language                                 : English
Default                                  : Yes
Forced                                   : No
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : A_AAC
Duration                                 : 2h 10mn
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 48.0 KHz
Compression mode                         : Lossy
Title                                    : AAC 2.0 @ 160 kbps
Language                                 : English
Default                                  : No
Forced                                   : No

@fritsch thought you would be interested in this one too.

My guess would be because the height is not /16.

There were also some kernel changes that may help with this. A new kernel has been built and you could give this a go (it is in staging). If you break anything you can go to to re-install the base image. I don’t normally recommend this but you seem to not mind a bit of tinkering


Width : 1 280 pixels
Height : 542 pixels

Shitty encoding. Currently not interested (cause of time) - the way the decoder works aligns to 16 and that results in those grey pixels.

Decoding: 16
Cropping: 8

@vajonam: ← align them all to 4 (e.g. change the 8 to 4) and see if it burns :slight_smile:

Give the new kernel a go first. Someone claims helps and this commit is in the Vero kernel tree now


Kernel won’t change it - cause we “align” in userspace, directly in the decoder, see the line I linked in my previous post. I cannot remember anymore, if that was a must / limitation somewhere, but I cannot imagine that concerning the dropping.

Btw. the original sample is not even % 8 … so very unfriendly for hw decoders.

So then the grey bar is some sort of padding? can that color not be changed to black? which would then not make it as obvious?

Fix your file :slight_smile: Or play with the codeline I sent you. That Code is OpenSource and you are very welcome to fiddle it out.

So changing the alignment to 4 didn’t help, as you said it didn’t didn’t align nicely, so changing it to 2 fixed it, not sure what other issues this will cause. @sam_nazarko said he would fiddle around w/ it too.

Yeah - we met on IRC. Looks fixed already - PR incoming to upstream.