{"action":"created","comment":{"url":"https://api.github.com/repos/01org/libyami/pulls/comments/93843866","pull_request_review_id":14377718,"id":93843866,"diff_hunk":"@@ -641,4 +683,72 @@ YamiStatus VaapiEncoderBase::getCodecConfig(VideoEncOutputBuffer* outBuffer)\n     return YAMI_SUCCESS;\n }\n \n+bool VaapiEncoderBase::fillQualityLevel(VaapiEncPicture* picture)\n+{\n+    if (VIDEO_PARAMS_QUALITYLEVEL_NONE == m_videoParamQualityLevel.level)\n+        return true;\n+\n+    if (mapQualityLevel()) {\n+        VAEncMiscParameterBufferQualityLevel* qualityLevel = NULL;\n+        if (picture->newMisc(VAEncMiscParameterTypeQualityLevel, qualityLevel))\n+            if (qualityLevel) {\n+                qualityLevel->quality_level = m_vaVideoParamQualityLevel;\n+                return true;\n+            }\n+    }\n+\n+    return false;\n+}\n+\n+bool VaapiEncoderBase::mapQualityLevel()\n+{\n+    if (0 == m_vaVideoParamQualityLevelMax) {\n+        VAConfigAttrib attrib;\n+        attrib.type = VAConfigAttribEncQualityRange;\n+        VAStatus vaStatus = vaGetConfigAttributes(m_display->getID(),\n+            m_videoParamCommon.profile, m_entrypoint,\n+            &attrib, 1);\n+        if (vaStatus != VA_STATUS_SUCCESS || VA_ATTRIB_NOT_SUPPORTED == attrib.value) {\n+            ERROR(\"unsupported params encode quality level setting!\");\n+            return false;\n+        }\n+        m_vaVideoParamQualityLevelMax = attrib.value;\n+    }\n+\n+    if (m_videoParamQualityLevelUpdated)\n+        if (!mapToRange(m_vaVideoParamQualityLevel,\n+                1, m_vaVideoParamQualityLevelMax,\n+                m_videoParamQualityLevel.level,\n+                VIDEO_PARAMS_QUALITYLEVEL_MIN, VIDEO_PARAMS_QUALITYLEVEL_MAX))\n+            return false;\n+\n+    m_videoParamQualityLevelUpdated = false;\n+\n+    return true;\n+}\n+\n+bool VaapiEncoderBase::mapToRange(uint32_t& value,\n+    uint32_t min, uint32_t max,\n+    uint32_t level,\n+    uint32_t minLevel, uint32_t maxLevel)\n+{\n+    float fValue;\n+    if (minLevel >= maxLevel) {","path":"encoder/vaapiencoder_base.cpp","position":219,"original_position":147,"commit_id":"8db1e331b222697cd89698f9565c9ecae9e1726f","original_commit_id":"8db1e331b222697cd89698f9565c9ecae9e1726f","user":{"login":"xuguangxin","id":6667546,"avatar_url":"https://avatars.githubusercontent.com/u/6667546?v=3","gravatar_id":"","url":"https://api.github.com/users/xuguangxin","html_url":"https://github.com/xuguangxin","followers_url":"https://api.github.com/users/xuguangxin/followers","following_url":"https://api.github.com/users/xuguangxin/following{/other_user}","gists_url":"https://api.github.com/users/xuguangxin/gists{/gist_id}","starred_url":"https://api.github.com/users/xuguangxin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xuguangxin/subscriptions","organizations_url":"https://api.github.com/users/xuguangxin/orgs","repos_url":"https://api.github.com/users/xuguangxin/repos","events_url":"https://api.github.com/users/xuguangxin/events{/privacy}","received_events_url":"https://api.github.com/users/xuguangxin/received_events","type":"User","site_admin":false},"body":"this duplicate with L241 too, consider use a function to do this","created_at":"2016-12-26T05:55:21Z","updated_at":"2016-12-26T05:55:21Z","html_url":"https://github.com/01org/libyami/pull/682#discussion_r93843866","pull_request_url":"https://api.github.com/repos/01org/libyami/pulls/682","_links":{"self":{"href":"https://api.github.com/repos/01org/libyami/pulls/comments/93843866"},"html":{"href":"https://github.com/01org/libyami/pull/682#discussion_r93843866"},"pull_request":{"href":"https://api.github.com/repos/01org/libyami/pulls/682"}}},"pull_request":{"url":"https://api.github.com/repos/01org/libyami/pulls/682","id":98124167,"html_url":"https://github.com/01org/libyami/pull/682","diff_url":"https://github.com/01org/libyami/pull/682.diff","patch_url":"https://github.com/01org/libyami/pull/682.patch","issue_url":"https://api.github.com/repos/01org/libyami/issues/682","number":682,"state":"open","locked":false,"title":"enc: implement vbr setting","user":{"login":"wudping","id":15758417,"avatar_url":"https://avatars.githubusercontent.com/u/15758417?v=3","gravatar_id":"","url":"https://api.github.com/users/wudping","html_url":"https://github.com/wudping","followers_url":"https://api.github.com/users/wudping/followers","following_url":"https://api.github.com/users/wudping/following{/other_user}","gists_url":"https://api.github.com/users/wudping/gists{/gist_id}","starred_url":"https://api.github.com/users/wudping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wudping/subscriptions","organizations_url":"https://api.github.com/users/wudping/orgs","repos_url":"https://api.github.com/users/wudping/repos","events_url":"https://api.github.com/users/wudping/events{/privacy}","received_events_url":"https://api.github.com/users/wudping/received_events","type":"User","site_admin":false},"body":"add interface to set VBR mode and HRD parameter for VP8, H264 and H265.\r\n\r\nfor [VIZ-8997](https://jira01.devtools.intel.com/browse/VIZ-8997)\r\n\r\nSigned-off-by: wudping <dongpingx.wu@intel.com>","created_at":"2016-12-15T10:34:11Z","updated_at":"2016-12-26T05:55:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11797779789b1039d3661bfedcd833f4ed9f4c71","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/01org/libyami/pulls/682/commits","review_comments_url":"https://api.github.com/repos/01org/libyami/pulls/682/comments","review_comment_url":"https://api.github.com/repos/01org/libyami/pulls/comments{/number}","comments_url":"https://api.github.com/repos/01org/libyami/issues/682/comments","statuses_url":"https://api.github.com/repos/01org/libyami/statuses/8db1e331b222697cd89698f9565c9ecae9e1726f","head":{"label":"wudping:VBR","ref":"VBR","sha":"8db1e331b222697cd89698f9565c9ecae9e1726f","user":{"login":"wudping","id":15758417,"avatar_url":"https://avatars.githubusercontent.com/u/15758417?v=3","gravatar_id":"","url":"https://api.github.com/users/wudping","html_url":"https://github.com/wudping","followers_url":"https://api.github.com/users/wudping/followers","following_url":"https://api.github.com/users/wudping/following{/other_user}","gists_url":"https://api.github.com/users/wudping/gists{/gist_id}","starred_url":"https://api.github.com/users/wudping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wudping/subscriptions","organizations_url":"https://api.github.com/users/wudping/orgs","repos_url":"https://api.github.com/users/wudping/repos","events_url":"https://api.github.com/users/wudping/events{/privacy}","received_events_url":"https://api.github.com/users/wudping/received_events","type":"User","site_admin":false},"repo":{"id":63393911,"name":"libyami","full_name":"wudping/libyami","owner":{"login":"wudping","id":15758417,"avatar_url":"https://avatars.githubusercontent.com/u/15758417?v=3","gravatar_id":"","url":"https://api.github.com/users/wudping","html_url":"https://github.com/wudping","followers_url":"https://api.github.com/users/wudping/followers","following_url":"https://api.github.com/users/wudping/following{/other_user}","gists_url":"https://api.github.com/users/wudping/gists{/gist_id}","starred_url":"https://api.github.com/users/wudping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wudping/subscriptions","organizations_url":"https://api.github.com/users/wudping/orgs","repos_url":"https://api.github.com/users/wudping/repos","events_url":"https://api.github.com/users/wudping/events{/privacy}","received_events_url":"https://api.github.com/users/wudping/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wudping/libyami","description":"Yet Another Media Infrastructure. it is core part of media codec with hardware acceleration, it is yummy to your video experience on Linux like platform.","fork":true,"url":"https://api.github.com/repos/wudping/libyami","forks_url":"https://api.github.com/repos/wudping/libyami/forks","keys_url":"https://api.github.com/repos/wudping/libyami/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wudping/libyami/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wudping/libyami/teams","hooks_url":"https://api.github.com/repos/wudping/libyami/hooks","issue_events_url":"https://api.github.com/repos/wudping/libyami/issues/events{/number}","events_url":"https://api.github.com/repos/wudping/libyami/events","assignees_url":"https://api.github.com/repos/wudping/libyami/assignees{/user}","branches_url":"https://api.github.com/repos/wudping/libyami/branches{/branch}","tags_url":"https://api.github.com/repos/wudping/libyami/tags","blobs_url":"https://api.github.com/repos/wudping/libyami/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wudping/libyami/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wudping/libyami/git/refs{/sha}","trees_url":"https://api.github.com/repos/wudping/libyami/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wudping/libyami/statuses/{sha}","languages_url":"https://api.github.com/repos/wudping/libyami/languages","stargazers_url":"https://api.github.com/repos/wudping/libyami/stargazers","contributors_url":"https://api.github.com/repos/wudping/libyami/contributors","subscribers_url":"https://api.github.com/repos/wudping/libyami/subscribers","subscription_url":"https://api.github.com/repos/wudping/libyami/subscription","commits_url":"https://api.github.com/repos/wudping/libyami/commits{/sha}","git_commits_url":"https://api.github.com/repos/wudping/libyami/git/commits{/sha}","comments_url":"https://api.github.com/repos/wudping/libyami/comments{/number}","issue_comment_url":"https://api.github.com/repos/wudping/libyami/issues/comments{/number}","contents_url":"https://api.github.com/repos/wudping/libyami/contents/{+path}","compare_url":"https://api.github.com/repos/wudping/libyami/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wudping/libyami/merges","archive_url":"https://api.github.com/repos/wudping/libyami/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wudping/libyami/downloads","issues_url":"https://api.github.com/repos/wudping/libyami/issues{/number}","pulls_url":"https://api.github.com/repos/wudping/libyami/pulls{/number}","milestones_url":"https://api.github.com/repos/wudping/libyami/milestones{/number}","notifications_url":"https://api.github.com/repos/wudping/libyami/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wudping/libyami/labels{/name}","releases_url":"https://api.github.com/repos/wudping/libyami/releases{/id}","deployments_url":"https://api.github.com/repos/wudping/libyami/deployments","created_at":"2016-07-15T05:22:26Z","updated_at":"2016-07-15T05:22:28Z","pushed_at":"2016-12-22T11:32:59Z","git_url":"git://github.com/wudping/libyami.git","ssh_url":"git@github.com:wudping/libyami.git","clone_url":"https://github.com/wudping/libyami.git","svn_url":"https://github.com/wudping/libyami","homepage":null,"size":4071,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"apache"}},"base":{"label":"01org:apache","ref":"apache","sha":"5d43e90dccfb1902429e52dfec3c383bb4a3de5e","user":{"login":"01org","id":1635439,"avatar_url":"https://avatars.githubusercontent.com/u/1635439?v=3","gravatar_id":"","url":"https://api.github.com/users/01org","html_url":"https://github.com/01org","followers_url":"https://api.github.com/users/01org/followers","following_url":"https://api.github.com/users/01org/following{/other_user}","gists_url":"https://api.github.com/users/01org/gists{/gist_id}","starred_url":"https://api.github.com/users/01org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/01org/subscriptions","organizations_url":"https://api.github.com/users/01org/orgs","repos_url":"https://api.github.com/users/01org/repos","events_url":"https://api.github.com/users/01org/events{/privacy}","received_events_url":"https://api.github.com/users/01org/received_events","type":"Organization","site_admin":false},"repo":{"id":18320220,"name":"libyami","full_name":"01org/libyami","owner":{"login":"01org","id":1635439,"avatar_url":"https://avatars.githubusercontent.com/u/1635439?v=3","gravatar_id":"","url":"https://api.github.com/users/01org","html_url":"https://github.com/01org","followers_url":"https://api.github.com/users/01org/followers","following_url":"https://api.github.com/users/01org/following{/other_user}","gists_url":"https://api.github.com/users/01org/gists{/gist_id}","starred_url":"https://api.github.com/users/01org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/01org/subscriptions","organizations_url":"https://api.github.com/users/01org/orgs","repos_url":"https://api.github.com/users/01org/repos","events_url":"https://api.github.com/users/01org/events{/privacy}","received_events_url":"https://api.github.com/users/01org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/01org/libyami","description":"Yet Another Media Infrastructure. it is core part of media codec with hardware acceleration, it is yummy to your video experience on Linux like platform.","fork":false,"url":"https://api.github.com/repos/01org/libyami","forks_url":"https://api.github.com/repos/01org/libyami/forks","keys_url":"https://api.github.com/repos/01org/libyami/keys{/key_id}","collaborators_url":"https://api.github.com/repos/01org/libyami/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/01org/libyami/teams","hooks_url":"https://api.github.com/repos/01org/libyami/hooks","issue_events_url":"https://api.github.com/repos/01org/libyami/issues/events{/number}","events_url":"https://api.github.com/repos/01org/libyami/events","assignees_url":"https://api.github.com/repos/01org/libyami/assignees{/user}","branches_url":"https://api.github.com/repos/01org/libyami/branches{/branch}","tags_url":"https://api.github.com/repos/01org/libyami/tags","blobs_url":"https://api.github.com/repos/01org/libyami/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/01org/libyami/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/01org/libyami/git/refs{/sha}","trees_url":"https://api.github.com/repos/01org/libyami/git/trees{/sha}","statuses_url":"https://api.github.com/repos/01org/libyami/statuses/{sha}","languages_url":"https://api.github.com/repos/01org/libyami/languages","stargazers_url":"https://api.github.com/repos/01org/libyami/stargazers","contributors_url":"https://api.github.com/repos/01org/libyami/contributors","subscribers_url":"https://api.github.com/repos/01org/libyami/subscribers","subscription_url":"https://api.github.com/repos/01org/libyami/subscription","commits_url":"https://api.github.com/repos/01org/libyami/commits{/sha}","git_commits_url":"https://api.github.com/repos/01org/libyami/git/commits{/sha}","comments_url":"https://api.github.com/repos/01org/libyami/comments{/number}","issue_comment_url":"https://api.github.com/repos/01org/libyami/issues/comments{/number}","contents_url":"https://api.github.com/repos/01org/libyami/contents/{+path}","compare_url":"https://api.github.com/repos/01org/libyami/compare/{base}...{head}","merges_url":"https://api.github.com/repos/01org/libyami/merges","archive_url":"https://api.github.com/repos/01org/libyami/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/01org/libyami/downloads","issues_url":"https://api.github.com/repos/01org/libyami/issues{/number}","pulls_url":"https://api.github.com/repos/01org/libyami/pulls{/number}","milestones_url":"https://api.github.com/repos/01org/libyami/milestones{/number}","notifications_url":"https://api.github.com/repos/01org/libyami/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/01org/libyami/labels{/name}","releases_url":"https://api.github.com/repos/01org/libyami/releases{/id}","deployments_url":"https://api.github.com/repos/01org/libyami/deployments","created_at":"2014-04-01T06:44:19Z","updated_at":"2016-12-20T07:21:59Z","pushed_at":"2016-12-26T05:33:44Z","git_url":"git://github.com/01org/libyami.git","ssh_url":"git@github.com:01org/libyami.git","clone_url":"https://github.com/01org/libyami.git","svn_url":"https://github.com/01org/libyami","homepage":null,"size":4015,"stargazers_count":54,"watchers_count":54,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":64,"mirror_url":null,"open_issues_count":30,"forks":64,"open_issues":30,"watchers":54,"default_branch":"apache"}},"_links":{"self":{"href":"https://api.github.com/repos/01org/libyami/pulls/682"},"html":{"href":"https://github.com/01org/libyami/pull/682"},"issue":{"href":"https://api.github.com/repos/01org/libyami/issues/682"},"comments":{"href":"https://api.github.com/repos/01org/libyami/issues/682/comments"},"review_comments":{"href":"https://api.github.com/repos/01org/libyami/pulls/682/comments"},"review_comment":{"href":"https://api.github.com/repos/01org/libyami/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/01org/libyami/pulls/682/commits"},"statuses":{"href":"https://api.github.com/repos/01org/libyami/statuses/8db1e331b222697cd89698f9565c9ecae9e1726f"}}}}
{"actor":{"display_login":"xuguangxin"}}