{"id":2200,"date":"2010-02-09T18:08:06","date_gmt":"2010-02-10T02:08:06","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=2200"},"modified":"2010-02-10T08:26:47","modified_gmt":"2010-02-10T16:26:47","slug":"parallelized-entropy-decoding","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/","title":{"rendered":"Designing a Codec For Parallelized Entropy Decoding"},"content":{"rendered":"<p>When I was banging my head hard on <a href=\"http:\/\/multimedia.cx\/eggs\/profiling-and-optimizing-theora\/\">FFmpeg&#8217;s VP3\/Theora VLC decoder<\/a>, I kept wondering if there&#8217;s a better way to do it. Libtheora shows us the way in that there obviously must be, since it can decode so much faster than FFmpeg.<\/p>\n<p>In the course of brainstorming better VLC approaches, I wondered about the concept of parallelizing the decoding operation somehow. This sounds awfully crazy, I know, and naturally, it&#8217;s intractable to directly parallelize VLC decoding since you can&#8217;t know where item (n+1) begins in the bitstream until you have decoded item (n). I thought it might be plausible to make a pass through the bitstream decoding all of the tokens and ancillary information into fixed lenth arrays and then make a second pass in order to sort out the information in some kind of parallelized manner. Due to the somewhat context-adaptive nature of Theora&#8217;s VLCs, I don&#8217;t know if I can make a go of that.<\/p>\n<p>Why can&#8217;t VLC decoding be done in parallel, either through SIMD or thread-level parallelization? I think the answer is clearly, &#8220;because the codecs weren&#8217;t designed for it&#8221;. Here&#8217;s the pitch: Create a codec bitstream format where the frame header contains indices pointing into the bitstream. For example, <a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=Sorenson_Video_1\">Sorenson Video 1<\/a> encodes the Y, U, and V planes in order and could be effectively decoded in parallel if only the frame header encoded offsets to the start of the U and V planes. Similarly, if a Theora frame header encoded offsets to certain coefficient groups in the header, that could facilitate multithreaded coefficient VLC decoding. Some other modifications would need to occur in the encoder, e.g., guaranteeing that no end-of-block runs cross coefficient group boundaries as they often do now.<\/p>\n<p>Taking this a step farther, think about arithmetic\/range coding. Decoding a bitstream encoded with such an algorithm notoriously requires a multiplication per value decoded. How about designing the bitstream in such a way that 2 or 4 multiplications can be done in parallel through any number of SIMD instruction sets?<\/p>\n<p>Do these ideas have any plausibility? I have this weird feeling that if they do, they&#8217;re probably already patented. If they aren&#8217;t, well, maybe this post can serve as prior art.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Entropy decoding seems so pesky and serial. Does it have to be?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[],"class_list":["post-2200","post","type-post","status-publish","format-standard","hentry","category-outlandish-brainstorms"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Entropy decoding seems so pesky and serial. Does it have to be?\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Multimedia Mike\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta property=\"og:description\" content=\"Entropy decoding seems so pesky and serial. Does it have to be?\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2010-02-10T02:08:06+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2010-02-10T16:26:47+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Entropy decoding seems so pesky and serial. Does it have to be?\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#article\",\"name\":\"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes\",\"headline\":\"Designing a Codec For Parallelized Entropy Decoding\",\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"},\"datePublished\":\"2010-02-09T18:08:06-08:00\",\"dateModified\":\"2010-02-10T08:26:47-08:00\",\"inLanguage\":\"en-US\",\"commentCount\":2,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#webpage\"},\"articleSection\":\"Outlandish Brainstorms\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/outlandish-brainstorms\\\/#listItem\",\"name\":\"Outlandish Brainstorms\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/outlandish-brainstorms\\\/#listItem\",\"position\":2,\"name\":\"Outlandish Brainstorms\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/outlandish-brainstorms\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#listItem\",\"name\":\"Designing a Codec For Parallelized Entropy Decoding\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#listItem\",\"position\":3,\"name\":\"Designing a Codec For Parallelized Entropy Decoding\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/outlandish-brainstorms\\\/#listItem\",\"name\":\"Outlandish Brainstorms\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/\",\"name\":\"Multimedia Mike\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Multimedia Mike\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#webpage\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/\",\"name\":\"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes\",\"description\":\"Entropy decoding seems so pesky and serial. Does it have to be?\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parallelized-entropy-decoding\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"datePublished\":\"2010-02-09T18:08:06-08:00\",\"dateModified\":\"2010-02-10T08:26:47-08:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes","description":"Entropy decoding seems so pesky and serial. Does it have to be?","canonical_url":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#article","name":"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes","headline":"Designing a Codec For Parallelized Entropy Decoding","author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"},"datePublished":"2010-02-09T18:08:06-08:00","dateModified":"2010-02-10T08:26:47-08:00","inLanguage":"en-US","commentCount":2,"mainEntityOfPage":{"@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#webpage"},"isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#webpage"},"articleSection":"Outlandish Brainstorms"},{"@type":"BreadcrumbList","@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs#listItem","position":1,"name":"Home","item":"https:\/\/multimedia.cx\/eggs","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/outlandish-brainstorms\/#listItem","name":"Outlandish Brainstorms"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/outlandish-brainstorms\/#listItem","position":2,"name":"Outlandish Brainstorms","item":"https:\/\/multimedia.cx\/eggs\/category\/outlandish-brainstorms\/","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#listItem","name":"Designing a Codec For Parallelized Entropy Decoding"},"previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#listItem","position":3,"name":"Designing a Codec For Parallelized Entropy Decoding","previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/outlandish-brainstorms\/#listItem","name":"Outlandish Brainstorms"}}]},{"@type":"Organization","@id":"https:\/\/multimedia.cx\/eggs\/#organization","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","url":"https:\/\/multimedia.cx\/eggs\/"},{"@type":"Person","@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author","url":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/","name":"Multimedia Mike","image":{"@type":"ImageObject","@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Multimedia Mike"}},{"@type":"WebPage","@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#webpage","url":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/","name":"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes","description":"Entropy decoding seems so pesky and serial. Does it have to be?","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/#website"},"breadcrumb":{"@id":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/#breadcrumblist"},"author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"creator":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"datePublished":"2010-02-09T18:08:06-08:00","dateModified":"2010-02-10T08:26:47-08:00"},{"@type":"WebSite","@id":"https:\/\/multimedia.cx\/eggs\/#website","url":"https:\/\/multimedia.cx\/eggs\/","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","inLanguage":"en-US","publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"}}]},"og:locale":"en_US","og:site_name":"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering","og:type":"article","og:title":"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes","og:description":"Entropy decoding seems so pesky and serial. Does it have to be?","og:url":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/","article:published_time":"2010-02-10T02:08:06+00:00","article:modified_time":"2010-02-10T16:26:47+00:00","twitter:card":"summary","twitter:title":"Designing a Codec For Parallelized Entropy Decoding | Breaking Eggs And Making Omelettes","twitter:description":"Entropy decoding seems so pesky and serial. Does it have to be?"},"aioseo_meta_data":{"post_id":"2200","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-31 21:59:32","updated":"2025-12-31 19:21:07","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\/category\/outlandish-brainstorms\/\" title=\"Outlandish Brainstorms\">Outlandish Brainstorms<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tDesigning a Codec For Parallelized Entropy Decoding\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/multimedia.cx\/eggs"},{"label":"Outlandish Brainstorms","link":"https:\/\/multimedia.cx\/eggs\/category\/outlandish-brainstorms\/"},{"label":"Designing a Codec For Parallelized Entropy Decoding","link":"https:\/\/multimedia.cx\/eggs\/parallelized-entropy-decoding\/"}],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2200","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=2200"}],"version-history":[{"count":4,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2200\/revisions"}],"predecessor-version":[{"id":2204,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/2200\/revisions\/2204"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=2200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=2200"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=2200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}