{"id":460758,"date":"2025-05-23T09:01:36","date_gmt":"2025-05-23T09:01:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=460758"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=460758","title":{"rendered":"<span>\u0423\u0441\u043a\u043e\u0440\u044f\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0438\u0434\u0435\u043e\u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 \u043d\u0430 1%<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d5d\/1bc\/55c\/d5d1bc55c838d9c82a245300f54bbd07.png\" width=\"740\" height=\"200\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/d5d\/1bc\/55c\/d5d1bc55c838d9c82a245300f54bbd07.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/d5d\/1bc\/55c\/d5d1bc55c838d9c82a245300f54bbd07.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 <a href=\"http:\/\/memorysafety.org\" rel=\"noopener noreferrer nofollow\">memorysafety.org<\/a><a href=\"https:\/\/www.memorysafety.org\/blog\/rav1d-perf-bounty\/\" rel=\"noopener noreferrer nofollow\"> \u043e\u0431\u044a\u044f\u0432\u0438\u043b \u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0435 <\/a>\u043f\u043e \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <code>rav1d<\/code> \u2014 \u043f\u043e\u0440\u0442\u0430 AV1-\u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 <code>dav1d<\/code> \u043d\u0430 Rust.<\/p>\n<p>\u041c\u043e\u044f \u0444\u0430\u043c\u0438\u043b\u0438\u044f \u0420\u0430\u0432\u0438\u0434, \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u0430\u0432\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c (\u0445\u043e\u0442\u044c \u044f \u0438, <em>\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e<\/em>, \u043d\u0435 \u0441\u043c\u043e\u0433\u0443 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0435).<\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0434\u0432\u0443\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u043c\u043d\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (<a href=\"https:\/\/github.com\/memorysafety\/rav1d\/pull\/1397\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u044b\u0439 PR<\/a>,\u00a0<a href=\"https:\/\/github.com\/memorysafety\/rav1d\/pull\/1400\" rel=\"noopener noreferrer nofollow\">\u0432\u0442\u043e\u0440\u043e\u0439 PR<\/a>) \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0438\u0445 \u043d\u0430\u0448\u0451\u043b.<\/p>\n<h3>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/memorysafety\/rav1d\" rel=\"noopener noreferrer nofollow\"><code>rav1d<\/code><\/a>\u00a0\u2014 \u044d\u0442\u043e \u043f\u043e\u0440\u0442 <a href=\"https:\/\/code.videolan.org\/videolan\/dav1d\" rel=\"noopener noreferrer nofollow\"><code>dav1d<\/code><\/a>, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 (1) \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 <code>dav1d<\/code> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/github.com\/immunant\/c2rust\" rel=\"noopener noreferrer nofollow\"><code>c2rust<\/code><\/a>, (2) \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435\u043c \u0432 <code>dav1d<\/code> \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e-\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 (3) \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c Rust \u0438 \u0431\u044b\u043b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u043e\u0440\u0442\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.memorysafety.org\/blog\/rav1d-performance-optimization\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a>\u00a0\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438 \u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0431\u044b\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043a\u043e\u043d\u043a\u0443\u0440\u0441 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439:<\/p>\n<blockquote>\n<p>\u041d\u0430\u0448 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 Rust \u0434\u0435\u043a\u043e\u0434\u0435\u0440 rav1d \u043f\u043e\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 5% \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 C \u0434\u0435\u043a\u043e\u0434\u0435\u0440 dav1d.<\/p>\n<\/blockquote>\n<p>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u0438\u0434\u0435\u043e\u0434\u0435\u043a\u043e\u0434\u0435\u0440\u044b \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u0441\u0445\u043e\u0436\u0438\u0445 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041e\u0442 \u043d\u0430\u0441 \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439, \u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f LLVM \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 Rust \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430 C), \u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u0442, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043b\u044f aarch64 (\u043c\u043e\u044f \u0441\u0440\u0435\u0434\u0430), \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0447\u0435\u043c \u0434\u043b\u044f x86_64.<\/p>\n<p>\u041c\u043e\u044f \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<ol>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u044d\u043c\u043f\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u043e\u0432 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432 \u0441 \u043e\u0434\u043d\u0438\u043c\u0438 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u00ab\u044f\u043a\u043e\u0440\u0435\u0439\u00bb, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430 Rust \u0438 \u043d\u0430 C, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0435\u0451.<\/p>\n<\/li>\n<\/ol>\n<h3>\u041e\u0442\u043f\u0440\u0430\u0432\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e (\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>hyperfine<\/code>\u00a0\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430 \u0438 \u0432 <a href=\"https:\/\/github.com\/memorysafety\/rav1d\/blob\/main\/.github\/workflows\/build-and-benchmark-x86.yml\" rel=\"noopener noreferrer nofollow\">CI<\/a> \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 <code>rav1d<\/code>).<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (<code>--threads 1<\/code>).<\/p>\n<p>\u0414\u043b\u044f <code>rav1d<\/code>:<\/p>\n<pre><code class=\"bash\">$ git clone git@github.com:memorysafety\/rav1d.git &amp;&amp; cd rav1d &amp;&amp; git log -n1 commit a654c1e82adb2d9a33ae50d2a82a7a747102cbb6 $ rustc --version --verbose # set by rust-toolchain.toml rustc 1.88.0-nightly (b45dd71d1 2025-04-30) ... LLVM version: 20.1.2 $ cargo build --release     Finished `release` profile [optimized] target(s) in .. $ hyperfine --warmup 2 \"target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1\" Benchmark 1: target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1   Time (mean \u00b1 \u03c3):     73.914 s \u00b1  0.151 s    [User: 73.295 s, System: 0.279 s]   Range (min \u2026 max):   73.770 s \u2026 74.132 s    10 runs<\/code><\/pre>\n<p>\u0414\u043b\u044f <code>dav1d<\/code>:<\/p>\n<pre><code class=\"bash\">$ git clone https:\/\/code.videolan.org\/videolan\/dav1d.git &amp;&amp; cd dav1d &amp;&amp; git checkout 1.5.1 $ brew install llvm@20 &amp;&amp; export CC=clang; $CC --version Homebrew clang version 20.1.4 $ meson setup build \"-Dbitdepths=['8','16']\" $ bear -- ninja -C build tools\/dav1d ... [88\/88] Linking target tools\/dav1d $ hyperfine --warmup 2 \"build\/tools\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1\" Benchmark 1: build\/tools\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1   Time (mean \u00b1 \u03c3):     67.912 s \u00b1  0.541 s    [User: 67.208 s, System: 0.282 s]   Range (min \u2026 max):   66.933 s \u2026 68.948 s    10 runs<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0430\u0439\u043b\u0430-\u043e\u0431\u0440\u0430\u0437\u0446\u0430 <code>rav1d<\/code>\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 9% (6 \u0441\u0435\u043a\u0443\u043d\u0434) \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c <code>dav1d<\/code>\u00a0 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043d\u0430 \u0447\u0438\u043f\u0435 M3).<\/p>\n<p>(\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 <code>clang<\/code>\u00a0\u0438 <code>rustc<\/code>\u00a0\u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u044e LLVM, \u043d\u043e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043f\u0430\u0442\u0447\u0435\u0439 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u0430.)<br \/>(\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 MacBook Air M3 \u0441 \u0432\u043e\u0441\u044c\u043c\u044c\u044e \u044f\u0434\u0440\u0430\u043c\u0438.)<\/p>\n<h3>\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u044d\u043c\u043f\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a <a href=\"https:\/\/github.com\/mstange\/samply\" rel=\"noopener noreferrer nofollow\">samply<\/a>, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e:<\/p>\n<pre><code class=\"bash\">.\/dav1d $ sudo samply record .\/build\/tools\/dav1d -q -i \/Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1 .\/rav1d $ sudo samply record .\/target\/release\/dav1d -q -i \/Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1<\/code><\/pre>\n<p>(\u0414\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Rust \u0442\u043e\u0436\u0435\u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>dav1d<\/code>, \u0447\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e.)<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>samply<\/code>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 1000 \u0413\u0446, \u0442\u043e \u0435\u0441\u0442\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440), \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 diff \u043f\u044f\u0442\u0438\u0441\u043e\u0442 \u0441\u044d\u043c\u043f\u043b\u043e\u0432 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 0,5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u0447\u0430\u0432 \u0441 \u0440\u0435\u0436\u0438\u043c\u0435 \u00ab\u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430\u00bb, \u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u044f\u043a\u043e\u0440\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c: \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445.<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0435 \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u044b \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043e\u043d\u043b\u0430\u0439\u043d \u0432 Firefox Profiler (<a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Fdav1d_profile.json.gz\/calltree\/?assemblyView=2~11c50~174~dav1d_filter_sbrow_cdef_8bpc&amp;globalTrackOrder=0&amp;search=dav1d_cdef_brow_8bpc&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\">dav1d<\/a>,\u00a0<a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Frav1d_profile_baseline.json.gz\/calltree\/?globalTrackOrder=0&amp;search=rav1d_cdef_brow&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\">rav1d<\/a>); \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438.<\/p>\n<p>\u0412\u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u044f <code>dav1d<\/code>\u00a0(\u043d\u0430 C) (\u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432: \u043e\u043a\u043e\u043b\u043e 69500):<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/12b\/86d\/511\/12b86d5116ca475165c5098429838f1d.png\" alt=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/dav1d_firefox_profiler.html\" title=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/dav1d_firefox_profiler.html\" width=\"698\" height=\"542\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/12b\/86d\/511\/12b86d5116ca475165c5098429838f1d.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/12b\/86d\/511\/12b86d5116ca475165c5098429838f1d.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/dav1d_firefox_profiler.html\" rel=\"noopener noreferrer nofollow\">https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/dav1d_firefox_profiler.html<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u044f <code>rav1d<\/code>\u00a0(\u043d\u0430 Rust) (\u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432: \u043e\u043a\u043e\u043b\u043e 75150):<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/571\/142\/67b\/57114267bbb95406903e9fd394e82a12.png\" alt=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler.html\" title=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler.html\" width=\"698\" height=\"542\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/571\/142\/67b\/57114267bbb95406903e9fd394e82a12.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/571\/142\/67b\/57114267bbb95406903e9fd394e82a12.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler.html\" rel=\"noopener noreferrer nofollow\">https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler.html<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>dav1d_cdef_brow_8bpc<\/code>\u00a0\u0438 <code>rav1d_cdef_brow<\/code>.<br \/><em>Total<\/em>\u00a0\u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u00ab\u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0441\u0442\u0435\u043a\u0430\u00bb, \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0438 \u0432\u0441\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0435\u044e \u00ab\u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0438. <em>Self<\/em>\u00a0\u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0441\u044d\u043c\u043f\u043b\u043e\u0432.<\/p>\n<p>\u041c\u0435\u0436\u0434\u0443 <code>dav1d<\/code>\u00a0\u0438 <code>rav1d<\/code> \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435: \u0445\u043e\u0442\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>_neon<\/code>\u00a0\u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a Arm \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e:<\/p>\n<ol>\n<li>\n<p><code>dav1d<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>cdef_filter_8x8_neon<\/code>\u00a0\u0438 <code>cdef_filter_4x4_neon<\/code>, \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445  \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0435\u0440\u0441\u0438\u044e <code>8<\/code>\u00a0\u0438\u043b\u0438 <code>4<\/code>).<\/p>\n<\/li>\n<li>\n<p><code>rav1d<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>cdef_filter_neon_erased<\/code>, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 <em>\u0432\u0441\u0435\u0445<\/em> \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u0430\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <code>cdef_filter8_pri_sec_edged_8bpc_neon<\/code>\u00a0\u043f\u043e\u0447\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e, \u0438 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043d\u0430 \u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0443\u0442\u0438.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0437\u0430\u043a\u0440\u043e\u0435\u043c \u0433\u043b\u0430\u0437\u0430 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>cdef_filter4_pri_edged_8bpc_neon<\/code>, \u0441\u044d\u043c\u043f\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 <em>\u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442<\/em>.<\/p>\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e (\u0410) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0\u0434\u043b\u044f <code>dav1d_cdef_brow_8bpc<\/code>\u00a0\u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <code>rav1d_cdef_brow<\/code>,\u00a0<strong>\u0438<\/strong>\u00a0(\u0411) \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>cdef_filter_{8x8,4x4}_neon<\/code>\u00a0\u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0\u0434\u043b\u044f <code>cdef_filter_neon_erased<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u043e\u0435-\u0447\u0442\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0435: \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0<code>cdef_filter_{8x8,4x4}_neon<\/code>\u00a0\u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 400 \u0441\u044d\u043c\u043f\u043b\u0430\u043c, \u0430 \u0443 <code>rav1d<\/code>\u2019s\u00a0<code>cdef_filter_neon_erased<\/code>\u00a0\u2014 \u043f\u043e\u0447\u0442\u0438 670 \u0441\u044d\u043c\u043f\u043b\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e <code>dav1d_cdef_brow_8bpc<\/code>\u00a0\u0438\u043c\u0435\u0435\u0442 1790 \u0441\u044d\u043c\u043f\u043b\u043e\u0432, \u0430 <code>rav1d_cdef_brow<\/code> \u2014 2350 \u0441\u044d\u043c\u043f\u043b\u043e\u0432.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 1% \u043e\u0431\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>rav1d<\/code>!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>cdef_filter_neon_erased<\/code>, \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>.cast()<\/code>, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0443 \u00ab\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443\u00bb, \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0443\u044e\u0441\u044f \u043a \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"rust\">#[deny(unsafe_op_in_unsafe_fn)] pub unsafe extern \"C\" fn cdef_filter_neon_erased&lt;     BD: BitDepth,     const W: usize,     const H: usize,     const TMP_STRIDE: usize,     const TMP_LEN: usize, &gt;(     \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e .. ) {     use crate::src::align::Align16;      \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..      let mut tmp_buf = Align16([0u16; TMP_LEN]);     let tmp = &amp;mut tmp_buf.0[2 * TMP_STRIDE + 8..];          padding::Fn::neon::&lt;BD, W&gt;().call::&lt;BD&gt;(tmp, dst, stride, left, top, bottom, H, edges);     filter::Fn::neon::&lt;BD, W&gt;().call(dst, stride, tmp, pri_strength, sec_strength, dir, damping, H, edges, bd); }<\/code><\/pre>\n<p><code>TMP_LEN<\/code>\u00a0\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>12 * 16 + 8 = 200<\/code>\u00a0\u0438\u043b\u0438 <code>12 * 8 + 8 = 104<\/code>, \u0442\u0430\u043a \u0447\u0442\u043e \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>tmp_buf = [u16; 200]<\/code>. \u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430!<\/p>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0435\u0442 <code>dav1d<\/code>?<\/p>\n<pre><code class=\"cpp\">#define DEFINE_FILTER(w, h, tmp_stride)                                      \\ static void                                                                  \\ cdef_filter_##w##x##h##_neon(\/* .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e .. *\/)                               \\ {                                                                            \\     ALIGN_STK_16(uint16_t, tmp_buf, 12 * tmp_stride + 8,);                   \\     uint16_t *tmp = tmp_buf + 2 * tmp_stride + 8;                            \\     BF(dav1d_cdef_padding##w, neon)(tmp, dst, stride,                        \\                                     left, top, bottom, h, edges);            \\     BF(dav1d_cdef_filter##w, neon)(dst, stride, tmp, pri_strength,           \\                                    sec_strength, dir, damping, h, edges      \\                                    HIGHBD_TAIL_SUFFIX);                      \\ }  DEFINE_FILTER(8, 8, 16) DEFINE_FILTER(4, 8, 8) DEFINE_FILTER(4, 4, 8)<\/code><\/pre>\n<p>\u0421\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c <code>uint16_t tmp_buf[200] __attribute__((aligned(16)));<\/code><\/p>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e <code>tmp_buf<\/code>\u00a0\u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 <code>cdef_filter_{8x8,4x4}_neon<\/code>: \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>padding<\/code>, \u0430 \u043f\u043e\u0437\u0436\u0435 \u0432 \u0442\u043e\u043c \u0436\u0435 \u0432\u0438\u0434\u0435 \u0434\u043b\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>filter<\/code>. \u041f\u043e\u0445\u043e\u0436\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e; \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>--emit=llvm-ir<\/code>:<\/p>\n<pre><code class=\"bash\">$ RUSTFLAGS=\"--emit=llvm-ir\" cargo build --release --target aarch64-apple-darwin<\/code><\/pre>\n<pre><code class=\"assembly\">; rav1d::src::cdef::neon::cdef_filter_neon_erased ; Function Attrs: nounwind define internal void @_ZN5rav1d3src4cdef4neon23cdef_filter_neon_erased17h7e4dbe8ecff68724E(ptr noundef %dst, i64 noundef %stride, ptr noundef %left, ptr noundef %top, ptr noundef %bottom, i32 noundef %pri_strength, i32 noundef %sec_strength, i32 noundef %dir, i32 noundef %damping, i32 noundef %edges, i32 noundef %bitdepth_max, ptr nocapture readnone %_dst, ptr nocapture readnone %_top, ptr nocapture readnone %_bottom) unnamed_addr #1 { start:   %tmp_buf = alloca [400 x i8], align 16   call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %tmp_buf)   call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %tmp_buf, i8 0, i64 400, i1 false)   %_37 = getelementptr inbounds nuw i8, ptr %tmp_buf, i64 80   call void @dav1d_cdef_padding8_16bpc_neon(ptr noundef nonnull %_37, ptr noundef %dst, i64 noundef %stride, ptr noundef %left, ptr noundef %top, ptr noundef %bottom, i32 noundef 8, i32 noundef %edges) #121   %edges2.i = zext i32 %edges to i64   %_0.i.i.i.i = and i32 %bitdepth_max, 65535   call void @dav1d_cdef_filter8_16bpc_neon(ptr noundef %dst, i64 noundef %stride, ptr noundef nonnull readonly align 2 %_37, i32 noundef %pri_strength, i32 noundef %sec_strength, i32 noundef %dir, i32 noundef %damping, i32 noundef 8, i64 noundef %edges2.i, i32 noundef %_0.i.i.i.i) #121   call void @llvm.lifetime.end.p0(i64 400, ptr nonnull %tmp_buf)   ret void }<\/code><\/pre>\n<h4>\u0423\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u043e\u0432 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 MaybeUninit<\/h4>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e! \u041a\u0430\u043a \u0440\u0430\u0437 \u043d\u0430 \u0442\u0430\u043a\u043e\u0439 \u0441\u043b\u0443\u0447\u0430\u0439 \u0432 Rust \u0435\u0441\u0442\u044c <a href=\"https:\/\/doc.rust-lang.org\/std\/mem\/union.MaybeUninit.html\" rel=\"noopener noreferrer nofollow\"><code>std::mem::MaybeUninit<\/code><\/a>:<\/p>\n<pre><code class=\"diff\">-let mut tmp_buf = Align16([0u16; TMP_LEN]) +let mut tmp_buf = Align16([MaybeUninit::&lt;u16&gt;::uninit(); TMP_LEN]);<\/code><\/pre>\n<p>\u041c\u044b \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u043c\u043e\u0436\u0435\u043c \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e \u0431\u0440\u0430\u0442\u044c sub-slice (<code>&amp;mut tmp_buf.0[2 * TMP_STRIDE + 8..]<\/code>), \u043d\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u0433\u043d\u0430\u0442\u0443\u0440\u044b \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0442\u0438\u043f (<code>tmp: *mut MaybeUninit&lt;u16&gt;<\/code>,\u00a0<code>tmp: &amp;[MaybeUninit&lt;u16&gt;]<\/code>).<\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0439 \u0438\u0445 \u043a\u043e\u0434 \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u0431\u044b\u043b \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u043c, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u043e\u0432\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 <code>unsafe<\/code>; \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0441\u0442\u0430\u0440\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0441\u044f (\u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e <code>dav1d<\/code>), \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u044b\u043c\u0438, \u0447\u0442\u043e \u0431\u0443\u0444\u0435\u0440 \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>\u0420\u0430\u043d\u0435\u0435 <code>cdef_filter_neon_erased<\/code>\u00a0\u0438\u043c\u0435\u043b\u0430 670\u00a0\u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c <a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Frav1d_profile_after.json.gz\/calltree\/?globalTrackOrder=0&amp;search=rav1d_cdef_brow&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\">\u043d\u043e\u0432\u044b\u0439 \u0441\u043d\u044d\u043f\u0448\u043e\u0442<\/a>:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/79e\/8f3\/d5d\/79e8f3d5d5357a10f774b06b17497acd.png\" alt=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_after_tmp_buf.html\" title=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_after_tmp_buf.html\" width=\"643\" height=\"604\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/79e\/8f3\/d5d\/79e8f3d5d5357a10f774b06b17497acd.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/79e\/8f3\/d5d\/79e8f3d5d5357a10f774b06b17497acd.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_after_tmp_buf.html\" rel=\"noopener noreferrer nofollow\">https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_after_tmp_buf.html<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u0412\u0441\u0435\u0433\u043e 274 \u0441\u044d\u043c\u043f\u043b\u043e\u0432! \u0427\u0443\u0442\u044c \u043c\u0435\u043d\u044c\u0448\u0435, \u0447\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0 <code>dav1d<\/code>\u2019s\u00a0<code>cdef_filter_{8x8,4x4}_neon<\/code>.<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044d\u0442\u043e \u043d\u0435 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 \u0432\u0440\u0435\u043c\u044f \u0432\u043f\u0443\u0441\u0442\u0443\u044e \u0442\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u043d\u0430 \u043e\u0431\u043d\u0443\u043b\u0435\u043d\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u043e\u0432? \u041f\u043e\u0438\u0441\u043a\u0430\u0432 \u0434\u0440\u0443\u0433\u0438\u0435 \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0431\u0443\u0444\u0435\u0440\u044b <code>Align16<\/code>, \u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b \u0443\u0434\u0430\u0447\u043d\u0443\u044e \u043d\u0430\u0445\u043e\u0434\u043a\u0443:<\/p>\n<pre><code class=\"rust\">pub(crate) fn rav1d_cdef_brow&lt;BD: BitDepth&gt;(\/* .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..*\/) {     \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..      for by in (by_start..by_end).step_by(2) {         \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..         let mut lr_bak =             Align16([[[[0.into(); 2 \/* x *\/]; 8 \/* y *\/]; 3 \/* plane *\/ ]; 2 \/* idx *\/]);                  \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..     } }<\/code><\/pre>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434 \u0438\u0437 <code>dav1d<\/code>\u00a0\u0442\u043e\u0436\u0435 \u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u044d\u0442\u043e\u0442 \u0431\u0443\u0444\u0435\u0440. \u0417\u0434\u0435\u0441\u044c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 <code>MaybeUninit<\/code>\u00a0\u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043d\u043e \u043c\u044b \u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442\u044c \u0441\u043a\u0440\u043e\u043c\u043d\u043e\u0435 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435: \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0442\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e <code>lr_bak<\/code>\u00a0\u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c, \u0442\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <strong>\u043e\u0434\u0438\u043d<\/strong> \u0440\u0430\u0437!<\/p>\n<pre><code class=\"diff\">pub(crate) fn rav1d_cdef_brow&lt;BD: BitDepth&gt;(\/* .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..*\/) {     \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e .. +   let mut lr_bak = +       Align16([[[[0.into(); 2 \/* x *\/]; 8 \/* y *\/]; 3 \/* plane *\/ ]; 2 \/* idx *\/]);              for by in (by_start..by_end).step_by(2) {         \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e .. -       let mut lr_bak = -           Align16([[[[0.into(); 2 \/* x *\/]; 8 \/* y *\/]; 3 \/* plane *\/ ]; 2 \/* idx *\/]);                  \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..     } }<\/code><\/pre>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a\u00a0<code>dav1d<\/code>\u00a0\u0432\u0441\u0451 \u0440\u0430\u0432\u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u0435\u0433\u043e \u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442, \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0447\u0442\u043e \u043b\u044e\u0431\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u0447\u0438\u0442\u0430\u0435\u043c\u044b\u0435 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430, \u0431\u044b\u043b\u0438 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b \u0441 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c. \u042d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0437\u0434\u0435\u0441\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u0430, \u043d\u043e \u0446\u0435\u043d\u043d\u0430 \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043f\u0435\u0439\u043a\u0430!<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 \u043f\u043e\u043b\u043d\u044b\u0439 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a, \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u0445\u043e\u0440\u043e\u0448\u0435\u0435 \u0443\u0432\u0435\u043b\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u043c\u0438 <code>73.914 s \u00b1 0.151 s<\/code>:<\/p>\n<pre><code class=\"bash\">$ hyperfine --warmup 2 \"target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1\" Benchmark 1: target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1   Time (mean \u00b1 \u03c3):     72.644 s \u00b1  0.250 s    [User: 72.023 s, System: 0.239 s]   Range (min \u2026 max):   72.281 s \u2026 73.098 s    10 runs<\/code><\/pre>\n<p>\u0414\u043e <code>dav1d<\/code> \u0441\u00a0\u0435\u0433\u043e <code>67.912 s \u00b1 0.541 s<\/code> \u043d\u0430\u043c \u0432\u0441\u0451 \u0435\u0449\u0451 \u0434\u0430\u043b\u0435\u043a\u043e, \u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 1,2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b (1,5%) \u043e\u0442 \u043e\u0431\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u2014 \u043e\u0442\u043b\u0438\u0447\u043d\u043e\u0435 \u043d\u0430\u0447\u0430\u043b\u043e, \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0449\u0435\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 20% \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430.<\/p>\n<h3>\u0421\u043d\u043e\u0432\u0430 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043d\u043e \u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u0438\u0437 \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u0430\u0442\u044c\u0438, \u043d\u043e \u043d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0440\u0435\u0436\u0438\u043c \u00ab\u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0442\u0435\u043a\u00bb.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/af5\/c7e\/037\/af5c7e03732b6755db5e3f57f75edc31.png\" alt=\"dav1d\u00a0(C)\" title=\"dav1d\u00a0(C)\" width=\"700\" height=\"304\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/af5\/c7e\/037\/af5c7e03732b6755db5e3f57f75edc31.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/af5\/c7e\/037\/af5c7e03732b6755db5e3f57f75edc31.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><code>dav1d<\/code>\u00a0(<a rel=\"noopener noreferrer nofollow\">C<\/a>)<\/figcaption><\/div>\n<\/figure>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0af\/92f\/81b\/0af92f81bcae66ad7d1555d96719ddcf.png\" alt=\"rav1d\u00a0(Rust)\" title=\"rav1d\u00a0(Rust)\" width=\"700\" height=\"304\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/0af\/92f\/81b\/0af92f81bcae66ad7d1555d96719ddcf.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/0af\/92f\/81b\/0af92f81bcae66ad7d1555d96719ddcf.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><code>rav1d<\/code>\u00a0(<a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Frav1d_profile_baseline.json.gz\/calltree\/?globalTrackOrder=0&amp;invertCallstack&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\">Rust<\/a>)<\/figcaption><\/div>\n<\/figure>\n<p>\u0421\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u043d\u043e \u043c\u043e\u0451 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u043b\u0435\u043a\u043b\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>add_temporal_candidate<\/code>: \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 \u043d\u0430 Rust \u0438 C \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u0430 (\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 400 \u0441\u044d\u043c\u043f\u043b\u043e\u0432, \u043e\u043a\u043e\u043b\u043e 0,5 \u0441\u0435\u043a\u0443\u043d\u0434\u044b), \u0430 \u0441\u0430\u043c\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0431\u0435\u0437\u043e\u0431\u0438\u0434\u043d\u043e: \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u044f\u0442\u044c\u0434\u0435\u0441\u044f\u0442 \u0441\u0442\u0440\u043e\u043a <code>if<\/code> \u0438 <code>for<\/code> \u0441 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0432\u044b\u0437\u043e\u0432\u0430\u043c\u0438 \u043a\u043e\u0440\u043e\u0442\u043a\u0438\u0445 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f, \u043a\u0443\u0434\u0430 \u0434\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c <code>rav1d<\/code>\u00a0\u0441 \u043e\u0442\u043b\u0430\u0434\u043e\u0447\u043d\u044b\u043c\u0438 \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438. \u0423\u0434\u043e\u0431\u043d\u043e, \u0447\u0442\u043e \u0432 <code>Cargo.toml<\/code> <code>rav1d<\/code>\u00a0\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d <code>[profile.release-with-debug]<\/code>; \u044d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"bash\">$ cargo build --profile=release-with-debug $ sudo samply record target\/release-with-debug\/dav1d ...<\/code><\/pre>\n<p><a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Frav1d_profile_with_debug.json.gz\/calltree\/?globalTrackOrder=0&amp;invertCallstack&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\">\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u043e\u0435<\/a> \u043d\u0430\u043c\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e: \u043f\u0440\u043e\u0444\u0438\u043b\u044c <code>release-with-debug<\/code>\u00a0\u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0441\u0442\u043e\u043b\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c, \u0430 \u0432\u044b\u0437\u043e\u0432\u044b \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043a\u0430\u0436\u0443\u0442\u0441\u044f \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435; \u0437\u0430\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c <strong>\u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u0443\u044e \u0440\u0430\u0437\u0431\u0438\u0432\u043a\u0443 \u0441\u044d\u043c\u043f\u043b\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/strong>, \u0447\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u043d\u0430\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0441 \u043f\u043e \u043d\u0443\u0436\u043d\u043e\u043c\u0443 \u043f\u0443\u0442\u0438.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b13\/c1e\/d7c\/b13c1ed7c17da21099b5fab83499355c.png\" alt=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_debug_add_temporal_func.html\" title=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_debug_add_temporal_func.html\" width=\"700\" height=\"304\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/b13\/c1e\/d7c\/b13c1ed7c17da21099b5fab83499355c.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/b13\/c1e\/d7c\/b13c1ed7c17da21099b5fab83499355c.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_debug_add_temporal_func.html\" rel=\"noopener noreferrer nofollow\">https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler_debug_add_temporal_func.html<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u043a\u0440\u043e\u043b\u043b\u0438\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u0440\u043e\u043a\u0438 <code>if <\/code><a href=\"http:\/\/cand.mv.mv\" rel=\"noopener noreferrer nofollow\"><code>cand.mv.mv<\/code><\/a><code>[0] == mv {<\/code>\u00a0\u0438 <code>if <\/code><a href=\"http:\/\/cand.mv\" rel=\"noopener noreferrer nofollow\"><code>cand.mv<\/code><\/a><code> == mvp {<\/code>\u00a0\u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u044e\u0442 600 \u0441\u044d\u043c\u043f\u043b\u043e\u0432!<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0434\u043d\u0438\u043c\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <code>mv: Mv<\/code> \u043d\u0430\u0432\u0435\u0440\u0445:<\/p>\n<pre><code class=\"rust\">#[derive(Clone, Copy, PartialEq, Eq, Default, FromZeroes, FromBytes, AsBytes)] #[repr(C)] pub struct Mv {     pub y: i16,     pub x: i16, }<\/code><\/pre>\n<p>\u0425\u043c. \u041a\u0430\u043a \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c? \u042d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e <code>#[derive(PartialEq)]<\/code>.<\/p>\n<p>\u0415\u0449\u0451 \u043f\u043e\u0434\u043e\u0437\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0435 \u0442\u043e, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f <code>dav1d<\/code>\u00a0\u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f, \u0432 \u043d\u0435\u0439 \u0434\u043b\u044f \u0442\u0435\u0445 \u0436\u0435 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f <code>mvstack[n].mv.n == mvp.n<\/code>. \u041d\u043e \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 <code>n<\/code>? \u0412\u0437\u0433\u043b\u044f\u043d\u0443\u0432 \u043d\u0430 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <code>mv<\/code> \u0432 <code>dav1d<\/code>, \u043c\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"cpp\">typedef union mv {     struct {         int16_t y, x;     };     uint32_t n; } mv;<\/code><\/pre>\n<p>\u041f\u043e\u0445\u043e\u0436\u0435, \u0430\u0432\u0442\u043e\u0440\u044b <code>dav1d<\/code>\u00a0\u0437\u043d\u0430\u043b\u0438, \u0447\u0442\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 <code>i16<\/code> \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u043c, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0434\u0432\u0443\u0445 <code>mv<\/code> \u043e\u043d\u0438 \u043e\u0431\u0440\u0430\u0449\u0430\u044e\u0442\u0441\u044f \u0441 \u043d\u0438\u043c\u0438, \u043a\u0430\u043a \u0441 <code>u32<\/code>s.<\/p>\n<h4>\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u043c \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u0435\u0439 \u043f\u043e\u0431\u0430\u0439\u0442\u043e\u0432\u044b\u043c \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e\u043c, \u0447\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f<\/h4>\n<p>\u041c\u043e\u0436\u0435\u0442 \u043b\u0438 \u044d\u0442\u043e \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439?<\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 <code>Mv<\/code>\u00a0\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 <code>union<\/code>\u00a0\u0438\u043c\u0435\u0435\u0442 \u0432 Rust \u043e\u0447\u0435\u043d\u044c \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u043a: \u0438\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043b\u044e\u0431\u044b\u043c \u043f\u043e\u043b\u044f\u043c <code>union<\/code> \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f <code>unsafe<\/code>, \u0447\u0442\u043e \u00ab\u0437\u0430\u0440\u0430\u0437\u0438\u0442\u00bb \u0432\u0441\u0435 \u0441\u043b\u0443\u0447\u0430\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <code>Mv<\/code>, \u0430 \u044d\u0442\u043e \u043f\u0440\u043e\u0442\u0438\u0432\u043e\u043f\u043e\u043b\u043e\u0436\u043d\u043e \u0442\u043e\u043c\u0443, \u043a \u0447\u0435\u043c\u0443 \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u0442\u0440\u0435\u043c\u0438\u043c\u0441\u044f \u0432 Rust (\u043f\u044b\u0442\u0430\u0435\u043c\u0441\u044f \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u044c \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u044b\u0439 API).<\/p>\n<p>\u041a \u0441\u0447\u0430\u0441\u0442\u044c\u044e, \u0435\u0441\u0442\u044c \u0438 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431: \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>transmute<\/code>\u00a0\u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0446\u0438\u0438 <code>Mv<\/code>\u00a0\u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u00a0<code>u32<\/code>, \u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>PartialEq<\/code>.<\/p>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0432 <a href=\"https:\/\/godbolt.org\/z\/r9MfTeY8b\" rel=\"noopener noreferrer nofollow\">Godbolt<\/a>, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0432\u0443\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/009\/275\/0bc\/0092750bc07df4938f4531b625719d8f.png\" alt=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/mv_eq_godbolt.html\" title=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/mv_eq_godbolt.html\" width=\"700\" height=\"494\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/009\/275\/0bc\/0092750bc07df4938f4531b625719d8f.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/009\/275\/0bc\/0092750bc07df4938f4531b625719d8f.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption><a href=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/mv_eq_godbolt.html\" rel=\"noopener noreferrer nofollow\">https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/mv_eq_godbolt.html<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0432\u0435\u0440\u0441\u0438\u044f \u0441 <code>transmute<\/code>\u00a0\u043b\u0443\u0447\u0448\u0435, \u043d\u043e \u043c\u043e\u0436\u0435\u043c \u043b\u0438 \u043c\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0431\u043b\u043e\u043a\u0430 <code>unsafe<\/code>?<sup>1<\/sup><\/p>\n<p>\u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u0440\u0435\u0439\u0442 <code>zerocopy<\/code>\u00a0\u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0435\u0440\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/docs.rs\/zerocopy\/latest\/zerocopy\/trait.IntoBytes.html#safety\" rel=\"noopener noreferrer nofollow\">\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 <\/a> <code>struct<\/code>\u00a0\u0434\u043b\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 <code>&amp;[u8]<\/code>, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<pre><code class=\"rust\">use zerocopy::{AsBytes, FromBytes, FromZeroes};  #[derive(Clone, Copy, Eq, Default, FromZeroes, FromBytes, AsBytes)] #[repr(C)] pub struct Mv {     pub y: i16,     pub x: i16, }  impl PartialEq for Mv {     #[inline(always)]     fn eq(&amp;self, other: &amp;Self) -&gt; bool {         self.as_bytes() == other.as_bytes()     } }<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0442\u043e\u0442 \u0436\u0435 (\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439) \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0439 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>transmute<\/code>.<\/p>\n<p>\u0420\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0432 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u043b\u044f <code>RefMvs{Mv,Ref}Pair<\/code>, \u043c\u043e\u0436\u043d\u043e \u0435\u0449\u0451 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a:<\/p>\n<pre><code class=\"bash\">$ hyperfine --warmup 2 \"target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1\" Benchmark 1: target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1   Time (mean \u00b1 \u03c3):     72.182 s \u00b1  0.289 s    [User: 71.501 s, System: 0.242 s]   Range (min \u2026 max):   71.850 s \u2026 72.722 s    10 runs<\/code><\/pre>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0435 \u0435\u0449\u0451 \u043d\u0430 0,5 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c (<code>72.644 s \u00b1 0.250 s<\/code>), \u0438\u043b\u0438 \u043d\u0430 2,3% \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439 (<code>73.914 s \u00b1 0.151 s<\/code>).<\/p>\n<p>\u041c\u044b \u0432\u0441\u0435\u0433\u043e \u043d\u0430 4,2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b \u043e\u0442\u0441\u0442\u0430\u0451\u043c \u043e\u0442 <code>dav1d<\/code> \u0441 \u0435\u0433\u043e\u00a0<code>67.912 s \u00b1 0.541 s<\/code>, \u0442\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043f\u043e\u043a\u0440\u044b\u043b\u0438 \u043e\u043a\u043e\u043b\u043e 30% \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0434\u0430\u0442\u044c\u0441\u044f \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u043c, \u043f\u043e\u0447\u0435\u043c\u0443 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f <code>PartialEq<\/code>\u00a0\u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043b\u043e\u0445\u043e\u0433\u043e \u043a\u043e\u0434\u0430: <a href=\"https:\/\/github.com\/memorysafety\/rav1d\/pull\/1400#issuecomment-2891734817\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/a>\u00a0\u0432 PR, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0435\u043c \u044d\u0442\u0438 impl, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 <a href=\"https:\/\/github.com\/rust-lang\/rust\/issues\/140167\" rel=\"noopener noreferrer nofollow\">Rust issue 140167<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0432\u044f\u0437\u0430\u043d \u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u0438\u043c \u0442\u0438\u043f\u043e\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u043b\u0443\u0447\u0430\u0439 C, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>struct { int16_t y, x; }<\/code>\u00a0\u043c\u043e\u0436\u043d\u043e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e <code>y<\/code>, \u043e\u0441\u0442\u0430\u0432\u0438\u0432 <code>x<\/code>\u00a0\u043d\u0435\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c. \u0415\u0441\u043b\u0438 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>this.y == other.y &amp;&amp; this.x == other.x<\/code>\u00a0\u0438 \u0432\u0441\u0435 <code>y<\/code> \u0440\u0430\u0437\u043d\u044b\u0435, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 UB \u043c\u044b \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c.<\/p>\n<p>\u0421\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e \u0434\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 \u043f\u0430\u043c\u044f\u0442\u044c \u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, <strong>\u0435\u0441\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0434 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u044b<\/strong>. \u041e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u043e\u0446\u0438\u0442\u0438\u0440\u0443\u0435\u043c <a href=\"https:\/\/github.com\/rust-lang\/rust\/issues\/140167#issuecomment-2895174679\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439<\/a>\u00a0@hanna-kruppe \u043f\u0440\u043e \u044d\u0442\u043e\u0442 issue:<\/p>\n<blockquote>\n<p>\u042d\u0442\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043f\u0443\u0449\u0435\u043d\u043d\u0430\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438. \u0425\u043e\u0442\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u043e\u043b\u044f \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c poison\/undef, \u044d\u0442\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u0435\u0442 control dependency. ..<br \/>\u0423\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443 \u0441\u043b\u043e\u0436\u043d\u043e: \u043d\u0435 \u0434\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u0432 LLVM \u0435\u0441\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435 \u00ab\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u043e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0432\u0441\u0435\u0433\u0434\u0430 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u0430\u0439\u0442\u044b\u00bb.<\/p>\n<\/blockquote>\n<h3>\u041f\u043e\u0434\u0432\u0435\u0434\u0451\u043c \u0438\u0442\u043e\u0433<\/h3>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u043e\u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 <code>samply<\/code>\u00a0\u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0443 <code>rav1d<\/code>\u00a0\u0438 <code>dav1d<\/code>\u00a0\u0441 \u043e\u0434\u043d\u0438\u043c \u0438 \u0442\u0435\u043c \u0436\u0435 \u0444\u0430\u0439\u043b\u043e\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0442\u043c\u0435\u0442\u0438\u043b\u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0443 \u0432 6 \u0441\u0435\u043a\u0443\u043d\u0434 (9%) \u0438 \u043d\u0430\u0448\u043b\u0438 \u0434\u0432\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438:<\/p>\n<ol>\n<li>\n<p>\u0423\u0441\u0442\u0440\u0430\u043d\u0438\u0432 \u0437\u0430\u0442\u0440\u0430\u0442\u043d\u0443\u044e \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0443\u043b\u044f\u043c\u0438 \u043d\u0430 \u0433\u043e\u0440\u044f\u0447\u0435\u043c \u043f\u0443\u0442\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u043e\u0433\u043e \u0434\u043b\u044f Arm (<a href=\"https:\/\/github.com\/memorysafety\/rav1d\/pull\/1397\" rel=\"noopener noreferrer nofollow\">PR<\/a>), \u0441\u043d\u0438\u0437\u0438\u0432 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430 1,2 \u0441\u0435\u043a\u0443\u043d\u0434\u044b (-1,6%).<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u043c\u0435\u043d\u0438\u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 impl <code>PartialEq<\/code>\u00a0\u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0445 <code>struct<\/code> \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0440\u0435\u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442 \u0438\u0445, \u043a\u0430\u043a \u0431\u0430\u0439\u0442\u044b (<a href=\"https:\/\/github.com\/memorysafety\/rav1d\/pull\/1400\" rel=\"noopener noreferrer nofollow\">PR<\/a>), \u0441\u043d\u0438\u0437\u0438\u0432 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430 0,5 \u0441\u0435\u043a\u0443\u043d\u0434\u044b (-0,7%).<\/p>\n<\/li>\n<\/ol>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u0438\u0437 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0434\u0435\u0441\u044f\u0442\u043a\u043e\u0432 \u0441\u0442\u0440\u043e\u043a, \u043e\u043d\u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044e\u0442 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0440\u043e\u0441\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u043d\u043e\u0432\u043e\u0439 \u043d\u0435\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0432 \u043a\u043e\u0434\u043e\u0432\u0443\u044e \u0431\u0430\u0437\u0443.<\/p>\n<p>\u041c\u0435\u0439\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <code>rav1d<\/code>\u00a0\u0431\u044b\u0441\u0442\u0440\u043e \u043e\u0442\u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u043d\u0430 \u043c\u043e\u0438 PR, \u043f\u043e\u043c\u043e\u0433\u043b\u0438 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0445 \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u043c\u0438 \u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c\u0438 (\u043e\u0433\u0440\u043e\u043c\u043d\u0430\u044f \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c @kkysen).<\/p>\n<p>\u041c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438 \u043f\u043e-\u043f\u0440\u0435\u0436\u043d\u0435\u043c\u0443 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 6%, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0435\u0449\u0451 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0439. \u041f\u043e\u0434\u043e\u0437\u0440\u0435\u0432\u0430\u044e, \u0442\u0430\u043a\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u043e\u0432 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 <a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Fdav1d_profile.json.gz\/calltree\/?assemblyView=2~11c50~174~dav1d_filter_sbrow_cdef_8bpc&amp;globalTrackOrder=0&amp;search=dav1d_cdef_brow_8bpc&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\"><code>dav1d<\/code><\/a>\u00a0\u0438 <a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Frav1d_profile_after.json.gz\/calltree\/?globalTrackOrder=0&amp;search=rav1d_cdef_brow&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\"><code>rav1d<\/code><\/a>\u00a0\u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0445\u043e\u0442\u044f \u0431\u044b \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<p>\u041c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0441\u0430\u043c\u0438! \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0433\u0434\u0430-\u0442\u043e <code>rav1d<\/code>\u00a0\u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0447\u0435\u043c <code>dav1d<\/code>&#8230;<\/p>\n<hr\/>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435 \u043e \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438: \u0445\u043e\u0442\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>use_transmute<\/code>\u00a0\u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0430, \u0437\u0434\u0435\u0441\u044c \u0435\u0441\u0442\u044c \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044c: \u0442\u0430\u043a \u043a\u0430\u043a <code>mem::align_of::&lt;Mv&gt; != mem::align_of::&lt;u32&gt;()<\/code>, \u043c\u044b <strong>\u043e\u0431\u044f\u0437\u0430\u043d\u044b<\/strong>\u00a0\u0440\u0430\u0437\u044b\u043c\u0435\u043d\u043e\u0432\u0430\u0442\u044c <code>&amp;Mv<\/code>\u00a0\u0437\u0430\u0440\u0430\u043d\u0435\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c Miri \u0432 <a href=\"https:\/\/play.rust-lang.org\/?version=stable&amp;mode=debug&amp;edition=2024&amp;gist=0942ed2780cf72760cf8890af47781d6\" rel=\"noopener noreferrer nofollow\">Playground<\/a>.<\/p>\n<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/912136\/\"> https:\/\/habr.com\/ru\/articles\/912136\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041a\u0430\u043a\u043e\u0435-\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 <a href=\"http:\/\/memorysafety.org\" rel=\"noopener noreferrer nofollow\">memorysafety.org<\/a><a href=\"https:\/\/www.memorysafety.org\/blog\/rav1d-perf-bounty\/\" rel=\"noopener noreferrer nofollow\"> \u043e\u0431\u044a\u044f\u0432\u0438\u043b \u043e \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0435 <\/a>\u043f\u043e \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 <code>rav1d<\/code> \u2014 \u043f\u043e\u0440\u0442\u0430 AV1-\u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 <code>dav1d<\/code> \u043d\u0430 Rust.<\/p>\n<p>\u041c\u043e\u044f \u0444\u0430\u043c\u0438\u043b\u0438\u044f \u0420\u0430\u0432\u0438\u0434, \u0441\u043e\u0432\u0441\u0435\u043c \u043a\u0430\u043a \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0431\u0430\u0432\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c (\u0445\u043e\u0442\u044c \u044f \u0438, <em>\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e<\/em>, \u043d\u0435 \u0441\u043c\u043e\u0433\u0443 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0435).<\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0434\u0432\u0443\u043c \u043d\u0430\u0439\u0434\u0435\u043d\u043d\u044b\u043c \u043c\u043d\u043e\u0439 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 (<a href=\"https:\/\/github.com\/memorysafety\/rav1d\/pull\/1397\" rel=\"noopener noreferrer nofollow\">\u043f\u0435\u0440\u0432\u044b\u0439 PR<\/a>,\u00a0<a href=\"https:\/\/github.com\/memorysafety\/rav1d\/pull\/1400\" rel=\"noopener noreferrer nofollow\">\u0432\u0442\u043e\u0440\u043e\u0439 PR<\/a>) \u0438 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0443 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u044f \u0438\u0445 \u043d\u0430\u0448\u0451\u043b.<\/p>\n<h3>\u041f\u0440\u0435\u0434\u044b\u0441\u0442\u043e\u0440\u0438\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0438<\/h3>\n<p><a href=\"https:\/\/github.com\/memorysafety\/rav1d\" rel=\"noopener noreferrer nofollow\"><code>rav1d<\/code><\/a>\u00a0\u2014 \u044d\u0442\u043e \u043f\u043e\u0440\u0442 <a href=\"https:\/\/code.videolan.org\/videolan\/dav1d\" rel=\"noopener noreferrer nofollow\"><code>dav1d<\/code><\/a>, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 (1) \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 <code>dav1d<\/code> \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <a href=\"https:\/\/github.com\/immunant\/c2rust\" rel=\"noopener noreferrer nofollow\"><code>c2rust<\/code><\/a>, (2) \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435\u043c \u0432 <code>dav1d<\/code> \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e-\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 (3) \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0434\u0430, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430\u043c Rust \u0438 \u0431\u044b\u043b \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u0435\u0435.<\/p>\n<p>\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0430\u0432\u0442\u043e\u0440\u044b \u043f\u043e\u0440\u0442\u0430 \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043b\u0438 <a href=\"https:\/\/www.memorysafety.org\/blog\/rav1d-performance-optimization\/\" rel=\"noopener noreferrer nofollow\">\u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a>\u00a0\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438 \u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u043d\u043d\u043e\u0439 \u0438\u043c\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0427\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435 \u0431\u044b\u043b \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d \u043a\u043e\u043d\u043a\u0443\u0440\u0441 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u043e\u0439:<\/p>\n<blockquote>\n<p>\u041d\u0430\u0448 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 Rust \u0434\u0435\u043a\u043e\u0434\u0435\u0440 rav1d \u043f\u043e\u043a\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 5% \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 C \u0434\u0435\u043a\u043e\u0434\u0435\u0440 dav1d.<\/p>\n<\/blockquote>\n<p>\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u0438\u0434\u0435\u043e\u0434\u0435\u043a\u043e\u0434\u0435\u0440\u044b \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u043d\u043e \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u0432\u0443\u0445 \u0441\u0445\u043e\u0436\u0438\u0445 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u0442\u043e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044d\u0442\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041e\u0442 \u043d\u0430\u0441 \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u044e\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u0439, \u0438 \u043c\u043e\u0436\u0435\u0442 \u043e\u043a\u0430\u0437\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0441 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0440\u0435\u0433\u0440\u0435\u0441\u0441\u0438\u044f\u043c\u0438 \u0442\u0440\u0443\u0434\u043d\u043e \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f LLVM \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043d\u0430 Rust \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u0432\u0435\u0440\u0441\u0438\u044e \u043d\u0430 C), \u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u0438\u0442, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432\u0435\u0440\u0441\u0438\u044f \u0434\u043b\u044f aarch64 (\u043c\u043e\u044f \u0441\u0440\u0435\u0434\u0430), \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u043c\u0435\u043d\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0447\u0435\u043c \u0434\u043b\u044f x86_64.<\/p>\n<p>\u041c\u043e\u044f \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c:<\/p>\n<ol>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u044d\u043c\u043f\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u043e\u0432 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0433\u043e\u043d\u043e\u0432 \u0441 \u043e\u0434\u043d\u0438\u043c\u0438 \u0438 \u0442\u0435\u043c\u0438 \u0436\u0435 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0435 \u0432\u044b\u0437\u043e\u0432\u044b \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u00ab\u044f\u043a\u043e\u0440\u0435\u0439\u00bb, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0430 Rust \u0438 \u043d\u0430 C, \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u044c \u0435\u0451.<\/p>\n<\/li>\n<\/ol>\n<h3>\u041e\u0442\u043f\u0440\u0430\u0432\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e (\u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>hyperfine<\/code>\u00a0\u0438 \u0444\u0430\u0439\u043b\u043e\u0432 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u0430\u0445 \u043a\u043e\u043d\u043a\u0443\u0440\u0441\u0430 \u0438 \u0432 <a href=\"https:\/\/github.com\/memorysafety\/rav1d\/blob\/main\/.github\/workflows\/build-and-benchmark-x86.yml\" rel=\"noopener noreferrer nofollow\">CI<\/a> \u0434\u0435\u043a\u043e\u0434\u0435\u0440\u0430 <code>rav1d<\/code>).<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043d\u0435 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u043e\u043f\u043e\u0442\u043e\u0447\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e (<code>--threads 1<\/code>).<\/p>\n<p>\u0414\u043b\u044f <code>rav1d<\/code>:<\/p>\n<pre><code class=\"bash\">$ git clone git@github.com:memorysafety\/rav1d.git &amp;&amp; cd rav1d &amp;&amp; git log -n1 commit a654c1e82adb2d9a33ae50d2a82a7a747102cbb6 $ rustc --version --verbose # set by rust-toolchain.toml rustc 1.88.0-nightly (b45dd71d1 2025-04-30) ... LLVM version: 20.1.2 $ cargo build --release     Finished `release` profile [optimized] target(s) in .. $ hyperfine --warmup 2 \"target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1\" Benchmark 1: target\/release\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1   Time (mean \u00b1 \u03c3):     73.914 s \u00b1  0.151 s    [User: 73.295 s, System: 0.279 s]   Range (min \u2026 max):   73.770 s \u2026 74.132 s    10 runs<\/code><\/pre>\n<p>\u0414\u043b\u044f <code>dav1d<\/code>:<\/p>\n<pre><code class=\"bash\">$ git clone https:\/\/code.videolan.org\/videolan\/dav1d.git &amp;&amp; cd dav1d &amp;&amp; git checkout 1.5.1 $ brew install llvm@20 &amp;&amp; export CC=clang; $CC --version Homebrew clang version 20.1.4 $ meson setup build \"-Dbitdepths=['8','16']\" $ bear -- ninja -C build tools\/dav1d ... [88\/88] Linking target tools\/dav1d $ hyperfine --warmup 2 \"build\/tools\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1\" Benchmark 1: build\/tools\/dav1d -q -i Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1   Time (mean \u00b1 \u03c3):     67.912 s \u00b1  0.541 s    [User: 67.208 s, System: 0.282 s]   Range (min \u2026 max):   66.933 s \u2026 68.948 s    10 runs<\/code><\/pre>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0430\u0439\u043b\u0430-\u043e\u0431\u0440\u0430\u0437\u0446\u0430 <code>rav1d<\/code>\u00a0\u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043d\u0430 9% (6 \u0441\u0435\u043a\u0443\u043d\u0434) \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c <code>dav1d<\/code>\u00a0 (\u043f\u043e \u043a\u0440\u0430\u0439\u043d\u0435\u0439 \u043c\u0435\u0440\u0435 \u043d\u0430 \u0447\u0438\u043f\u0435 M3).<\/p>\n<p>(\u0412 \u0438\u0434\u0435\u0430\u043b\u0435 <code>clang<\/code>\u00a0\u0438 <code>rustc<\/code>\u00a0\u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0434\u043d\u0443 \u0438 \u0442\u0443 \u0436\u0435 \u0432\u0435\u0440\u0441\u0438\u044e LLVM, \u043d\u043e, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e, \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0432 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 \u043f\u0430\u0442\u0447\u0435\u0439 \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u0430.)<br \/>(\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0434\u0435\u043d\u044b \u043d\u0430 MacBook Air M3 \u0441 \u0432\u043e\u0441\u044c\u043c\u044c\u044e \u044f\u0434\u0440\u0430\u043c\u0438.)<\/p>\n<h3>\u041f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h3>\n<p>\u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0441\u044d\u043c\u043f\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a <a href=\"https:\/\/github.com\/mstange\/samply\" rel=\"noopener noreferrer nofollow\">samply<\/a>, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0431\u044b\u0447\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e:<\/p>\n<pre><code class=\"bash\">.\/dav1d $ sudo samply record .\/build\/tools\/dav1d -q -i \/Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1 .\/rav1d $ sudo samply record .\/target\/release\/dav1d -q -i \/Chimera-AV1-8bit-1920x1080-6736kbps.ivf -o \/dev\/null --threads 1<\/code><\/pre>\n<p>(\u0414\u0432\u043e\u0438\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Rust \u0442\u043e\u0436\u0435\u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f <code>dav1d<\/code>, \u0447\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0442\u0440\u0430\u043d\u043d\u043e.)<\/p>\n<p>\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e <code>samply<\/code>\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0447\u0430\u0441\u0442\u043e\u0442\u0443 1000 \u0413\u0446, \u0442\u043e \u0435\u0441\u0442\u044c (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440), \u043d\u0430 \u043b\u044e\u0431\u043e\u0439 diff \u043f\u044f\u0442\u0438\u0441\u043e\u0442 \u0441\u044d\u043c\u043f\u043b\u043e\u0432 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 0,5 \u0441\u0435\u043a\u0443\u043d\u0434 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u0441\u0443\u0437\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0434\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043c\u043e\u0436\u043d\u043e, \u043d\u0430\u0447\u0430\u0432 \u0441 \u0440\u0435\u0436\u0438\u043c\u0435 \u00ab\u0438\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0441\u0442\u0435\u043a\u0430\u00bb, \u043d\u043e \u0432 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u044f\u043a\u043e\u0440\u044f\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c: \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445.<\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u043d\u044b\u0435 \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u044b \u043f\u0440\u043e\u0444\u0438\u043b\u0438\u0440\u043e\u0432\u0449\u0438\u043a\u0430 \u043e\u043d\u043b\u0430\u0439\u043d \u0432 Firefox Profiler (<a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Fdav1d_profile.json.gz\/calltree\/?assemblyView=2~11c50~174~dav1d_filter_sbrow_cdef_8bpc&amp;globalTrackOrder=0&amp;search=dav1d_cdef_brow_8bpc&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\">dav1d<\/a>,\u00a0<a href=\"https:\/\/profiler.firefox.com\/from-url\/https%3A%2F%2Fohadravid.github.io%2F2025-05-rav1d-faster%2Frav1d_profile_baseline.json.gz\/calltree\/?globalTrackOrder=0&amp;search=rav1d_cdef_brow&amp;thread=0&amp;v=10\" rel=\"noopener noreferrer nofollow\">rav1d<\/a>); \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u044b \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438.<\/p>\n<p>\u0412\u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u044f <code>dav1d<\/code>\u00a0(\u043d\u0430 C) (\u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432: \u043e\u043a\u043e\u043b\u043e 69500):<\/p>\n<figure class=\"full-width\">\n<div><figcaption><a href=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/dav1d_firefox_profiler.html\" rel=\"noopener noreferrer nofollow\">https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/dav1d_firefox_profiler.html<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u0410 \u0432\u043e\u0442 \u0432\u0435\u0440\u0441\u0438\u044f <code>rav1d<\/code>\u00a0(\u043d\u0430 Rust) (\u043e\u0431\u0449\u0435\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432: \u043e\u043a\u043e\u043b\u043e 75150):<\/p>\n<figure class=\"full-width\">\n<div><figcaption><a href=\"https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler.html\" rel=\"noopener noreferrer nofollow\">https:\/\/ohadravid.github.io\/2025-05-rav1d-faster\/rav1d_firefox_profiler.html<\/a><\/figcaption><\/div>\n<\/figure>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>dav1d_cdef_brow_8bpc<\/code>\u00a0\u0438 <code>rav1d_cdef_brow<\/code>.<br \/><em>Total<\/em>\u00a0\u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0430\u0441\u044c \u00ab\u0432 \u043b\u044e\u0431\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u0441\u0442\u0435\u043a\u0430\u00bb, \u0447\u0442\u043e \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442 \u0438 \u0432\u0441\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 \u0435\u044e \u00ab\u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435\u00bb \u0444\u0443\u043d\u043a\u0446\u0438\u0438. <em>Self<\/em>\u00a0\u2014 \u044d\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043e\u043d\u0430 \u0431\u044b\u043b\u0430 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0435\u0437 \u0443\u0447\u0451\u0442\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0445 \u0441\u044d\u043c\u043f\u043b\u043e\u0432.<\/p>\n<p>\u041c\u0435\u0436\u0434\u0443 <code>dav1d<\/code>\u00a0\u0438 <code>rav1d<\/code> \u0435\u0441\u0442\u044c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0435: \u0445\u043e\u0442\u044f \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 <code>_neon<\/code>\u00a0\u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0435\u0441\u044f \u043a Arm \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043e\u0431\u0449\u0438\u0435 \u0434\u043b\u044f \u043e\u0431\u043e\u0438\u0445 \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e:<\/p>\n<ol>\n<li>\n<p><code>dav1d<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>cdef_filter_8x8_neon<\/code>\u00a0\u0438 <code>cdef_filter_4x4_neon<\/code>, \u0438 \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043d\u0438\u0445  \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u044b\u0435 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 (\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0435\u0440\u0441\u0438\u044e <code>8<\/code>\u00a0\u0438\u043b\u0438 <code>4<\/code>).<\/p>\n<\/li>\n<li>\n<p><code>rav1d<\/code>\u00a0\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>cdef_filter_neon_erased<\/code>, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 <em>\u0432\u0441\u0435\u0445<\/em> \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439.<\/p>\n<\/li>\n<\/ol>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043d\u044d\u043f\u0448\u043e\u0442\u0430\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <code>cdef_filter8_pri_sec_edged_8bpc_neon<\/code>\u00a0\u043f\u043e\u0447\u0442\u0438 \u0438\u0434\u0435\u043d\u0442\u0438\u0447\u043d\u043e, \u0438 \u044d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043d\u0430 \u0432\u0435\u0440\u043d\u043e\u043c \u043f\u0443\u0442\u0438.<\/p>\n<p>\u041f\u043e\u043a\u0430 \u0437\u0430\u043a\u0440\u043e\u0435\u043c \u0433\u043b\u0430\u0437\u0430 \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>cdef_filter4_pri_edged_8bpc_neon<\/code>, \u0441\u044d\u043c\u043f\u043b\u044b \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435 <em>\u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442<\/em>.<\/p>\n<p>\u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e (\u0410) \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0\u0434\u043b\u044f <code>dav1d_cdef_brow_8bpc<\/code>\u00a0\u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0443 \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <code>rav1d_cdef_brow<\/code>,\u00a0<strong>\u0438<\/strong>\u00a0(\u0411) \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 <code>cdef_filter_{8x8,4x4}_neon<\/code>\u00a0\u0434\u043e\u043b\u0436\u043d\u0430 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u0442\u044c \u0441 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0\u0434\u043b\u044f <code>cdef_filter_neon_erased<\/code>.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u043e\u0435-\u0447\u0442\u043e \u043b\u044e\u0431\u043e\u043f\u044b\u0442\u043d\u043e\u0435: \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u044d\u043c\u043f\u043b\u043e\u0432 <em>Self<\/em>\u00a0<code>cdef_filter_{8x8,4x4}_neon<\/code>\u00a0\u0440\u0430\u0432\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 400 \u0441\u044d\u043c\u043f\u043b\u0430\u043c, \u0430 \u0443 <code>rav1d<\/code>\u2019s\u00a0<code>cdef_filter_neon_erased<\/code>\u00a0\u2014 \u043f\u043e\u0447\u0442\u0438 670 \u0441\u044d\u043c\u043f\u043b\u043e\u0432. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0447\u0442\u043e <code>dav1d_cdef_brow_8bpc<\/code>\u00a0\u0438\u043c\u0435\u0435\u0442 1790 \u0441\u044d\u043c\u043f\u043b\u043e\u0432, \u0430 <code>rav1d_cdef_brow<\/code> \u2014 2350 \u0441\u044d\u043c\u043f\u043b\u043e\u0432.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c \u044d\u0442\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e 1% \u043e\u0431\u0449\u0435\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f <code>rav1d<\/code>!<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>cdef_filter_neon_erased<\/code>, \u043d\u0435 \u043e\u0431\u0440\u0430\u0449\u0430\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 <code>.cast()<\/code>, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043b\u0438\u0448\u044c \u043e\u0434\u043d\u0443 \u00ab\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0440\u0430\u0431\u043e\u0442\u0443\u00bb, \u043d\u0435 \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0443\u044e\u0441\u044f \u043a \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430\u043c \u0432\u044b\u0437\u043e\u0432\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"rust\">#[deny(unsafe_op_in_unsafe_fn)] pub unsafe extern \"C\" fn cdef_filter_neon_erased&lt;     BD: BitDepth,     const W: usize,     const H: usize,     const TMP_STRIDE: usize,     const TMP_LEN: usize, &gt;(     \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e .. ) {     use crate::src::align::Align16;      \/\/ .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e ..      let mut tmp_buf = Align16([0u16; TMP_LEN]);     let tmp = &amp;mut tmp_buf.0[2 * TMP_STRIDE + 8..];          padding::Fn::neon::&lt;BD, W&gt;().call::&lt;BD&gt;(tmp, dst, stride, left, top, bottom, H, edges);     filter::Fn::neon::&lt;BD, W&gt;().call(dst, stride, tmp, pri_strength, sec_strength, dir, damping, H, edges, bd); }<\/code><\/pre>\n<p><code>TMP_LEN<\/code>\u00a0\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c <code>12 * 16 + 8 = 200<\/code>\u00a0\u0438\u043b\u0438 <code>12 * 8 + 8 = 104<\/code>, \u0442\u0430\u043a \u0447\u0442\u043e \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 <code>tmp_buf = [u16; 200]<\/code>. \u0411\u043e\u043b\u044c\u0448\u043e\u0439 \u043e\u0431\u044a\u0451\u043c \u043e\u0431\u043d\u0443\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0431\u0443\u0444\u0435\u0440\u0430!<\/p>\n<p>\u0427\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u0430\u0435\u0442 <code>dav1d<\/code>?<\/p>\n<pre><code class=\"cpp\">#define DEFINE_FILTER(w, h, tmp_stride)                                      \\ static void                                                                  \\ cdef_filter_##w##x##h##_neon(\/* .. \u0432\u044b\u0440\u0435\u0437\u0430\u043d\u043e .. *\/)                               \\ {                                                                            \\     ALIGN_STK_16(uint16_t, tmp_buf, 12 * tmp_stride + 8,);                   \\     uint16_t *tmp = tmp_buf + 2 * tmp_stride + 8;                            \\     BF(dav1d_cdef_padding##w, neon)(tmp, dst, stride,                        \\                                     left, top, bottom, h, edges);            \\     BF(dav1d_cdef_filter##w, neon)(dst, stride, tmp, pri_strength,           \\                                    sec_strength, dir, damping, h, edges      \\                                    HIGHBD_TAIL_SUFFIX);                      \\ }  DEFINE_FILTER(8, 8, 16) DEFINE_FILTER(4, 8, 8) DEFINE_FILTER(4, 4, 8)<\/code><\/pre>\n<p>\u0421\u043f\u0443\u0441\u0442\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0439 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043c\u044b \u043d\u0430\u0445\u043e\u0434\u0438\u043c <code>uint16_t tmp_buf[200] __attribute__((aligned(16)));<\/code><\/p>\n<p>\u042d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e <code>tmp_buf<\/code>\u00a0\u043d\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 <code>cdef_filter_{8x8,4x4}_neon<\/code>: \u0432\u043c\u0435\u0441\u0442\u043e \u044d\u0442\u043e\u0433\u043e \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u0435\u0441\u0442\u043e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>padding<\/code>, \u0430 \u043f\u043e\u0437\u0436\u0435 \u0432 \u0442\u043e\u043c \u0436\u0435 \u0432\u0438\u0434\u0435 \u0434\u043b\u044f \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>filter<\/code>. \u041f\u043e\u0445\u043e\u0436\u0435, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043d\u0435 \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a \u0443\u0441\u0442\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e; \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u0438\u0437\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u043e, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>--emit=llvm-ir<\/code>:<\/p>\n<pre><code class=\"bash\">$ RUSTFLAGS=\"--emit=llvm-ir\" cargo build --release --target aarch64-apple-darwin<\/code><\/pre>\n<pre><code class=\"assembly\">; rav1d::src::cdef::neon::cdef_filter_neon_erased ; Function Attrs: nounwind define internal void @_ZN5rav1d3src4cdef4neon23cdef_filter_neon_erased17h7e4dbe8ecff68724E(ptr noundef %dst, i64 noundef %stride, ptr noundef %left, ptr noundef %top, ptr noundef %bottom, i32 noundef %pri_strength, i32 noundef %sec_strength, i32 noundef %dir, i32 noundef %damping, i32 noundef %edges, i32 noundef %bitdepth_max, ptr nocapture readnone %_dst, ptr nocapture readnone %_top, ptr nocapture readnone %_bottom) unnamed_addr #1 { start:   %tmp_buf = alloca [400 x i8], align 16   call void @llvm.lifetime.start.p0(i64 400, ptr nonnull %tmp_buf)   call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(400) %tmp_buf, i8 0, i64 400, i1 false)   %_37 = getelementptr inbounds nuw i8, ptr %tmp_buf, i64 80   call void @dav1d_cdef_padding8_16bpc_neon(ptr noundef nonnull %_37, ptr noundef %dst, i64<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-460758","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/460758","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=460758"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/460758\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=460758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=460758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=460758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}