payload: {"action":"created","issue":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/6564","repository_url":"https://api.github.com/repos/mpv-player/mpv","labels_url":"https://api.github.com/repos/mpv-player/mpv/issues/6564/labels{/name}","comments_url":"https://api.github.com/repos/mpv-player/mpv/issues/6564/comments","events_url":"https://api.github.com/repos/mpv-player/mpv/issues/6564/events","html_url":"https://github.com/mpv-player/mpv/pull/6564","id":421797623,"node_id":"MDExOlB1bGxSZXF1ZXN0MjYxNzY2MjI4","number":6564,"title":"vo_gpu: implement error diffusion for dithering","user":{"login":"bjin","id":175336,"node_id":"MDQ6VXNlcjE3NTMzNg==","avatar_url":"https://avatars3.githubusercontent.com/u/175336?v=4","gravatar_id":"","url":"https://api.github.com/users/bjin","html_url":"https://github.com/bjin","followers_url":"https://api.github.com/users/bjin/followers","following_url":"https://api.github.com/users/bjin/following{/other_user}","gists_url":"https://api.github.com/users/bjin/gists{/gist_id}","starred_url":"https://api.github.com/users/bjin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjin/subscriptions","organizations_url":"https://api.github.com/users/bjin/orgs","repos_url":"https://api.github.com/users/bjin/repos","events_url":"https://api.github.com/users/bjin/events{/privacy}","received_events_url":"https://api.github.com/users/bjin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-03-16T11:30:14Z","updated_at":"2019-03-16T18:51:03Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/mpv-player/mpv/pulls/6564","html_url":"https://github.com/mpv-player/mpv/pull/6564","diff_url":"https://github.com/mpv-player/mpv/pull/6564.diff","patch_url":"https://github.com/mpv-player/mpv/pull/6564.patch"},"body":"This is a straightforward parallel implementation of error diffusion\r\nalgorithms in compute shader. Basically we use single work group with\r\nmaximal possible size to process the whole image. After a shift\r\nmapping we are able to process all pixels column by column.\r\n\r\nA large ring buffer are allocated in shared memory to speed things up.\r\nHowever the size of required shared memory depends linearly on the\r\nheight of video window (or screen height in fullscreen mode). In case\r\nthere is no enough share memory, it will fallback to '--dither=fruit'.\r\n\r\nThe maximal allowed work group size is hardcoded as 1024. Ideally we\r\ncould query GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS. But for whatever\r\nreason, it seems most high end card from nvidia and amd support only\r\nthe minimal required value, so I guess we can stick to it for now.\r\n\r\nTested on Linux with Intel HD 4000. Rendering time is 22ms on 1920x1080 for `sierra-lite`."},"comment":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/comments/473574358","html_url":"https://github.com/mpv-player/mpv/pull/6564#issuecomment-473574358","issue_url":"https://api.github.com/repos/mpv-player/mpv/issues/6564","id":473574358,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MzU3NDM1OA==","user":{"login":"haasn","id":1149047,"node_id":"MDQ6VXNlcjExNDkwNDc=","avatar_url":"https://avatars0.githubusercontent.com/u/1149047?v=4","gravatar_id":"","url":"https://api.github.com/users/haasn","html_url":"https://github.com/haasn","followers_url":"https://api.github.com/users/haasn/followers","following_url":"https://api.github.com/users/haasn/following{/other_user}","gists_url":"https://api.github.com/users/haasn/gists{/gist_id}","starred_url":"https://api.github.com/users/haasn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haasn/subscriptions","organizations_url":"https://api.github.com/users/haasn/orgs","repos_url":"https://api.github.com/users/haasn/repos","events_url":"https://api.github.com/users/haasn/events{/privacy}","received_events_url":"https://api.github.com/users/haasn/received_events","type":"User","site_admin":false},"created_at":"2019-03-16T18:51:03Z","updated_at":"2019-03-16T18:51:03Z","author_association":"MEMBER","body":"I understand. For an image viewer you are right, it makes more sense. And for some reason, good dithering is annoyingly difficult to accomplish with other methods (e.g. imagemagick).\r\n\r\nThe code is isolated enough that I'd be happy merging it as long as it doesn't get into our way in the future. I will provide some code comments though, when I get the time to review this properly."}}
other: {"actor":{"display_login":"haasn"}}