{"id":3067,"date":"2010-12-09T23:31:15","date_gmt":"2010-12-10T07:31:15","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=3067"},"modified":"2010-12-09T23:31:15","modified_gmt":"2010-12-10T07:31:15","slug":"more-weird-vp8-encodings","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/more-weird-vp8-encodings\/","title":{"rendered":"More Weird VP8 Encodings"},"content":{"rendered":"<p>When I announced that I had <a href=\"http:\/\/multimedia.cx\/eggs\/the-big-vp8-debug\/\">transitioned my VP8 encoder&#8217;s status from &#8220;toy&#8221; to &#8220;working&#8221;<\/a>, <a href=\"http:\/\/multimedia.cx\/eggs\/the-big-vp8-debug\/#comment-156585\">Jim L. lamented<\/a> the loss of humorous posts about oddly encoded images output from my encoder. <strong>Not so!<\/strong> There are still plenty of features that I have yet to implement, each of which carries the possibility of bizarre images.<\/p>\n<p>For example, I dusted off my work-in-progress intra 4&#215;4 encoding, fixed a few of the more obvious bugs, and told the encoder to encode the first block in 4&#215;4 mode and the rest in the usual, working, debugged 16&#215;16 mode. The results of the first pass surprised me:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-4x4-attempt.jpg\" alt=\"\" title=\"First attempt at VP8 i4x4 encoding\" width=\"400\" height=\"250\" class=\"alignnone size-full wp-image-3068\" srcset=\"https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-4x4-attempt.jpg 400w, https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-4x4-attempt-300x187.jpg 300w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><br \/>\n<\/center><\/p>\n<p>The reason this surprised me was that I intuitively expected one of 2 outcomes:<\/p>\n<ul>\n<li><strong>Perfect image<\/strong> right away since everything is correct (very unlikely but not outside the realm of possibility)<\/li>\n<li><strong>Total garbage<\/strong> with, at most, the first macroblock looking somewhat legible; this would be due to having some of the first macroblock correct but completely desynchronizing the bitstream for the purpose of decoding the rest of the coefficients.<\/li>\n<\/ul>\n<p>I absolutely <em>did not<\/em> expect the first macroblock to look messed up but for the rest of the picture to look fine. For fun, I reversed the logic and encoded the first block as 16&#215;16 and the rest with the experimental 4&#215;4 mode:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-inside-out.jpg\" alt=\"\" title=\"VP8 only encoding chroma, no luma\" width=\"640\" height=\"360\" class=\"alignnone size-full wp-image-3069\" srcset=\"https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-inside-out.jpg 640w, https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-inside-out-300x168.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><br \/>\n<\/center><\/p>\n<p>If you examine carefully, you will see that the color planes are correct (though faint). There just isn&#8217;t much going on in the luma plane. This made sense when I noticed the encoder was encoding a blank (undefined, actually) set of luma coefficients for 4&#215;4 mode macroblocks due to a bug. This helps to rationalize the first image as well&#8211; the first macroblock was encoding nonsense for the first macroblock which messed up the macroblocks which immediately surrounded it. Eventually, macroblock decoding got back on track when the prediction modes weren&#8217;t relying on the errantly decoded macroblocks.<\/p>\n<p>After I fixed that bug, I let the 4&#215;4 mode rip through the whole image. That&#8217;s when I got what I am terming the &#8220;dark and gritty reboot of Big Buck Bunny&#8221;:<\/p>\n<p><center><br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-dark-gritty.jpg\" alt=\"\" title=\"Dark and gritty reboot of Big Buck Bunny\" width=\"640\" height=\"360\" class=\"alignnone size-full wp-image-3070\" srcset=\"https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-dark-gritty.jpg 640w, https:\/\/multimedia.cx\/eggs\/wp-content\/uploads\/2010\/12\/bbb-dark-gritty-300x168.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><br \/>\n<\/center><\/p>\n<p>Fortunately, this also turned out to be traceable to a pretty obvious code bug.<\/p>\n<p>One day, this VP8 encoder might do the right thing while implementing all of the algorithm&#8217;s features. In the meantime, it&#8217;s at least entertaining to watch it make mistakes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>More curious images output from my VP8 encoder<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[219],"tags":[],"class_list":["post-3067","post","type-post","status-publish","format-standard","hentry","category-vp8"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3067","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=3067"}],"version-history":[{"count":5,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3067\/revisions"}],"predecessor-version":[{"id":3075,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/3067\/revisions\/3075"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=3067"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=3067"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=3067"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}