{"id":823,"date":"2013-11-03T16:52:19","date_gmt":"2013-11-03T08:52:19","guid":{"rendered":"http:\/\/guoh.ai\/lifelog\/?p=823"},"modified":"2013-11-04T10:56:59","modified_gmt":"2013-11-04T02:56:59","slug":"h-264-intra-prediction","status":"publish","type":"post","link":"https:\/\/guoh.ai\/lifelog\/2013\/11\/h-264-intra-prediction\/","title":{"rendered":"H.264\u9884\u6d4b\u4e4b\u5e27\u5185\u9884\u6d4b"},"content":{"rendered":"<p>\u8fd9\u662f\u4e00\u7bc7\u9605\u8bfb\u7b14\u8bb0\uff0c\u76f4\u63a5\u70b9\u51fb\u56fe\u7247\u53ef\u4ee5\u67e5\u770b\u6e05\u6670\u5927\u56fe\u3002<\/p>\n<p>\u53c2\u8003\u8d44\u6599<br \/>\nThe H.264 Advanced Video Compression Standard, Second Edition\uff0c\u4ee5\u4e0b\u7b80\u79f0<strong>THAVCS<\/strong><br \/>\nInformation technology &#8211; Coding of audio-visual objects &#8211; Part 10: Advanced Video Coding\uff0c\u4ee5\u4e0b\u7b80\u79f0SPEC<\/p>\n<p>CodecVisa<br \/>\nJM<br \/>\nforeman_part_qcif.264 \u8fd9\u4e2a\u662fforeman_part_qcif.yuv\u901a\u8fc7JM 8.6\u8f6c\u6362\u6765\u7684<\/p>\n<p>http:\/\/blog.csdn.net\/stpeace\/article\/details\/8114826<\/p>\n<p>\u7b80\u5355\u7684\u7406\u89e3\u5e27\u5185\u9884\u6d4b\u5c31\u662f\u5229\u7528\u8be5\u5e27\u91cc\u9762\u5df2\u7ecf\u7f16\u7801\u548c\u91cd\u6784\u597d\u7684\u5757\u6765\u7f16\u7801\u6570\u636e\uff0c\u5177\u4f53\u505a\u6cd5\u5c31\u662f\u7528\u5f53\u524d\u5757\u51cf\u53bb\u9884\u6d4b\u5757\uff0c\u5f97\u5230\u7684\u6570\u636e\u518d\u7f16\u7801<\/p>\n<p>\u6bd4\u5982:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n\u7f16\u7801\u597d\u7684\u5757 B\r\n\u9884\u6d4b\u5757 P\r\n\u5f53\u524d\u5757 C\r\n\r\nDelta = C - P\r\nP\u662f\u6839\u636eB\u9884\u6d4b\u6765\u7684\uff0cDelta\u662f\u6700\u7ec8\u8fdb\u884c\u7f16\u7801\u7684\u6570\u636e\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u7ecf\u5e38\u8bf4\u7684Residual\r\n<\/pre>\n<p>\u5bf9\u4e8e\u4eae\u5ea6\u5206\u91cf\uff0cP\u4e00\u822c\u662f4 x 4\u7684\u5757\u6216\u800516 x 16\u7684\u5b8f\u5757(8 x 8\u7684\u53ea\u5728high profile\u5f53\u4e2d\u51fa\u73b0)\uff0c\u5bf9\u4e8e\u7ec6\u8282\u6bd4\u8f83\u4e30\u5bcc\u7684\u5730\u65b9\u4f7f\u75284 x 4\u7684\u5757\uff0c\u5bf9\u4e8e\u6bd4\u8f83\u5e73\u5766\u7684\u5730\u65b9\u4f7f\u752816 x 16\u7684\u5757\u7684(\u8fd9\u6837\u505a\u7684\u539f\u56e0\u5c31\u662f\u901a\u5e38\u5757\u5206\u7684\u8d8a\u7ec6\u5c31\u9700\u8981\u8d8a\u591a\u7684\u4f4d\u6765\u5b58\u653e\u8fd9\u4e9b\u5757\u81ea\u8eab\u7684\u4fe1\u606f\uff0c\u4f46\u9884\u6d4b\u7684\u6b98\u5dee\u4f1a\u6bd4\u8f83\u5c0f\uff1b\u5757\u5206\u7684\u8d8a\u5927\uff0c\u5b58\u653e\u5757\u672c\u8eab\u4fe1\u606f\u6240\u5360\u7528\u6bd4\u8f83\u5c11\u7684\u4f4d\uff0c\u9884\u6d4b\u7684\u65f6\u5019\u6b98\u5dee\u5c31\u4f1a\u5360\u7528\u66f4\u591a\u7684\u4f4d\uff0c\u6240\u4ee5\u8fd9\u662f\u4e00\u4e2a\u6743\u8861)\u3002\u5e76\u4e14\u6211\u4eec\u4e00\u822c\u8bb0\u4f5c4 \u00d7 4 Luma Prediction\u548c16 \u00d7 16 Luma Prediction\u3002<br \/>\n4 \u00d7 4 Luma Prediction\u67099\u79cd\u9884\u6d4b\u6a21\u5f0f\uff0c\u53c2\u89c1THAVCS\u4e66\u7684Figure 6.10\u548cFigure 6.11\uff0c\u540d\u5b57\u5c31\u4e0d\u4e00\u4e00\u5217\u4e3e\u4e86\uff0c\u8fd9\u91cc\u6709\u622a\u56fe\u3002<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641551993\/\" title=\"4-x-4-intra-prediction-modes by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm8.staticflickr.com\/7321\/10641551993_5afd5206e4_o.png\" width=\"831\" height=\"702\" alt=\"4-x-4-intra-prediction-modes\"><\/a><br \/>\n\u90a3\u8fd9\u4e48\u591a\u9884\u6d4b\u6a21\u5f0f\u6211\u4eec\u5230\u5e95\u4f7f\u7528\u54ea\u4e00\u4e2a\u662f\u5982\u4f55\u51b3\u5b9a\u7684\u5462\uff1f\u8fd9\u91cc\u5c31\u6d89\u53ca\u5230\u4e00\u4e2aSAE(Sum of Absolute Errors)\uff0c\u8fd9\u4e2aSAE\u8868\u793a\u9884\u6d4b\u7684\u9519\u8bef\u6216\u8005\u504f\u5dee\uff0c\u660e\u663eSAE\u8d8a\u5927\u8d8a\u4e0d\u51c6\u786e\uff0c\u6240\u4ee5\u8fd9\u91cc\u6211\u4eec\u5f53\u7136\u9009\u62e9SAE\u6700\u5c0f\u7684\u90a3\u4e2a\uff0c\u81f3\u4e8eSAE\u662f\u5982\u4f55\u7b97\u51fa\u6765\u7684\uff0c\u6211\u4eec\u6682\u65f6\u4e0d\u8003\u8651\u3002<br \/>\n16 \u00d7 16 Luma Prediction\u67094\u79cd\u9884\u6d4b\u6a21\u5f0f\uff0c\u53c2\u89c1THAVCS\u4e66\u7684Figure 6.13\uff0c\u622a\u56fe\u5982\u4e0b\uff0c\u5f53\u7136\u9009\u7528\u90a3\u79cd\u6a21\u5f0f\u8ddf\u4e0a\u9762\u7684\u65b9\u6cd5\u4e00\u6837\uff0c\u4e5f\u662f\u770bSAE\u3002<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641550813\/\" title=\"16-x-16-intra-prediction-modes by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm6.staticflickr.com\/5510\/10641550813_bf7c8d48e3_o.png\" width=\"763\" height=\"252\" alt=\"16-x-16-intra-prediction-modes\"><\/a><br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641328274\/\" title=\"16-x-16-intra-prediction-modes-descriptions by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm4.staticflickr.com\/3734\/10641328274_7b344944b7_o.png\" width=\"740\" height=\"143\" alt=\"16-x-16-intra-prediction-modes-descriptions\"><\/a><\/p>\n<p>\u5bf9\u4e8e\u8272\u5ea6\u5206\u91cf\uff0cP\u4e00\u822c\u662f8 x 8\u7684\u5757\uff0c\u8bb0\u4f5c8 \u00d7 8 Chroma Prediction\u3002\u5b83\u4e5f\u662f\u67094\u79cd\u9884\u6d4b\u6a21\u5f0f\uff0c\u8ddf16 \u00d7 16 Luma Prediction\u4e00\u6837\uff0c\u53ea\u662f\u6a21\u5f0f\u7684\u7f16\u53f7\u4e0d\u4e00\u6837\uff0c\u5177\u4f53\u5982\u4e0b\uff0c<strong>DC(mode 0)\uff0c Horizontal(mode 1)\uff0cVertical(mode 2)\u548cPlane(mode 3)<\/strong>\u3002<\/p>\n<p>\u77e5\u9053\u8fd9\u4e9b\u603b\u4f53\u4e0a\u7684\u77e5\u8bc6\u4e4b\u540e\uff0c\u6211\u4eec\u6765\u7a0d\u5fae\u6df1\u5165\u770b\u770b\u5177\u4f53\u7684\uff0c\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u7528\u5230CodecVisa\u4e86\u3002\u6253\u5f00\u7801\u6d41\uff0c\u53ef\u4ee5\u770b\u5230MB(MacroBlock)\u4fe1\u606f\u5982\u4e0b\uff0c<br \/>\n\u4eceMB\u7edf\u8ba1\u4fe1\u606f(h.264-foreman-1st-frame-mb-statistics)\u6765\u770b\uff0c\u8be5Picture\u662fI-Slice\uff0c\u4e00\u5171\u670999\u4e2aI-MBs\uff0c94\u4e2aI_NxN\u7c7b\u578b\uff0c2\u4e2aI_16x16_0_0_0\u7c7b\u578b\uff0c1\u4e2aI_16x16_2_0_0\u7c7b\u578b\uff0c1\u4e2aI_16x16_3_1_0\u7c7b\u578b\u4ee5\u53ca1\u4e2aI_16x16_2_0_1\u7c7b\u578b\uff0c\u5177\u4f53\u8fd9\u4e9b\u7c7b\u578b\u7684\u542b\u4e49\u53ef\u4ee5\u53c2\u89c1SPEC\u7684Table 7-11 \u2013 Macroblock types for I slices\u3002<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641329956\/\" title=\"h.264-foreman-1st-frame-mb-statistics by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm4.staticflickr.com\/3704\/10641329956_c568e6ceb5_o.png\" width=\"288\" height=\"205\" alt=\"h.264-foreman-1st-frame-mb-statistics\"><\/a><br \/>\n\u5404\u4e2aMB\u7684\u5206\u5e03\u60c5\u51b5\u5982\u4e0b\uff0c\u5f53\u7136\u4e0b\u56fe\u53ea\u80fd\u6bd4\u8f83\u5bb9\u6613\u7684\u533a\u5206\u51fa16 x 16\u76845\u4e2aMB\uff0c<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641324944\/\" title=\"h.264-foreman-1st-frame-mb by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm6.staticflickr.com\/5514\/10641324944_9d664c4c9c_o.png\" width=\"232\" height=\"183\" alt=\"h.264-foreman-1st-frame-mb\"><\/a><br \/>\n\u53e6\u5916\u7b2c\u4e00\u4e2aMB\u7684\u8be6\u7ec6\u4fe1\u606f\u5982\u4e0b\uff0c<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641550543\/\" title=\"h.264-foreman-1st-frame-1st-mb by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm4.staticflickr.com\/3757\/10641550543_15377afbe6_o.png\" width=\"848\" height=\"599\" alt=\"h.264-foreman-1st-frame-1st-mb\"><\/a><\/p>\n<p>I_16x16_0_0_0\u8868\u793a\u9884\u6d4b\u6a21\u578b\u662f0(Vertical)\uff0c\u800c\u4e14\u6211\u4eec\u77e5\u9053\u8fd9\u662fY\u5206\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u5bf9\u7167CodecVisa\u9a8c\u8bc1\u3002\u901a\u8fc7h.264-foreman-1st-frame-i_16x16_0_0_0-mb\u6211\u4eec\u53ef\u4ee5\u770b\u89c1\u8fd9\u4e2aMB\u7684\u9884\u6d4b\u503c\u90fd\u662f237\uff0c\u800c\u4e14\u56e0\u4e3a\u5b83\u7684\u9884\u6d4b\u6a21\u578b\u662fVertical\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u63a8\u7406\u51fa\uff0c\u8be5MB\u4e0a\u9762\u5bf9\u5e94\u7684\u4f4d\u7f6e\u7684\u503c\u5e94\u8be5\u4e5f\u90fd\u662f237\uff0c\u901a\u8fc7CodecVisa\u67e5\u770b\u5bf9\u5e94\u4f4d\u7f6e\u7684\u6570\u636e\u622a\u56fe\u5982h.264-foreman-1st-frame-i_16x16_0_0_0-mb-up-mb\uff0c\u53ef\u4ee5\u770b\u51fa\u786e\u5b9e\u662f237\uff0c\u8fd9\u4e0e\u6211\u4eec\u8bf4\u7684Vertical\u6a21\u5f0f\u6b63\u597d\u543b\u5408\u3002\u81f3\u4e8e\u5b9e\u9645\u503c\u662f236\uff0c\u8fd9\u5f53\u7136\u9884\u6d4b\u7684\u503c\u548c\u5b9e\u9645\u503c\u80af\u5b9a\u662f\u6709\u8bef\u5dee\u7684\uff0c\u6240\u4ee5\u8fd9\u4e2a\u8bef\u5dee-1\u901a\u8fc7Residual\u8bb0\u5f55\u4e0b\u6765\u3002<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641300625\/\" title=\"h.264-foreman-1st-frame-i_16x16_0_0_0-mb-up-mb by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm3.staticflickr.com\/2894\/10641300625_f9851dc592_o.png\" width=\"1416\" height=\"616\" alt=\"h.264-foreman-1st-frame-i_16x16_0_0_0-mb-up-mb\"><\/a><br \/>\n\u4e0b\u9762\u662f\u9884\u6d4b\u503c<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641334306\/\" title=\"h.264-foreman-1st-frame-i_16x16_0_0_0-mb by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm6.staticflickr.com\/5482\/10641334306_e42886b159_o.png\" width=\"1281\" height=\"631\" alt=\"h.264-foreman-1st-frame-i_16x16_0_0_0-mb\"><\/a><\/p>\n<p>I_16x16_2_0_0\u8868\u793a\u9884\u6d4b\u6a21\u578b\u662f2(DC)\uff0c\u8fd9\u4e5f\u662fY\u5206\u91cf\uff0c\u540c\u7406\u6211\u4eec\u4e5f\u53ef\u4ee5\u9a8c\u8bc1\u3002DC\u662fUp\u7684\u503c\u548cLeft\u7684\u503c\u7684\u5747\u503c\uff0c\u5373((237 * 12 + 229 + 222 + 213 + 206) + (236 * 16)) \/ (16 * 2)\uff0c\u7ea6\u7b49\u4e8e234\uff0c\u8fd9\u91cc\u53d6\u6574\u7684\u8bef\u5dee\u6211\u4eec\u8ba4\u4e3a\u8fd9\u4e9b\u8bef\u5dee\u662f\u53ef\u4ee5\u63a5\u53d7\u7684\uff0c\u901a\u8fc7CodecVisa\u6211\u4eec\u4e5f\u53ef\u4ee5\u89c2\u5bdf\u51fa\u6765\uff0c\u9884\u6d4b\u503c\u786e\u5b9e\u4e3a234\u3002<br \/>\nUp\u548cLeft\u7684MB\u5982\u4e0b<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641325264\/\" title=\"h.264-foreman-1st-frame-i_16x16_2_0_0-up-mb by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm6.staticflickr.com\/5496\/10641325264_f82a6b7aeb_o.png\" width=\"1429\" height=\"650\" alt=\"h.264-foreman-1st-frame-i_16x16_2_0_0-up-mb\"><\/a><br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641326504\/\" title=\"h.264-foreman-1st-frame-i_16x16_2_0_0-left-mb by DeliberateKids, on Flickr\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm3.staticflickr.com\/2876\/10641326504_3bc5c71275_o.png\" width=\"1393\" height=\"625\" alt=\"h.264-foreman-1st-frame-i_16x16_2_0_0-left-mb\"><\/a><br \/>\n\u9884\u6d4b\u503c\u4e3a<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10641332156\/\" title=\"h.264-foreman-1st-frame-i_16x16_2_0_0-mb by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm3.staticflickr.com\/2845\/10641332156_2d1e1e70fc_o.png\" width=\"1272\" height=\"653\" alt=\"h.264-foreman-1st-frame-i_16x16_2_0_0-mb\"><\/a><\/p>\n<p>\u53e6\u5916\u6bd4\u59824 x 4\u7684Horizontal Up\/Down\u8fd9\u4e9b\u8981\u989d\u5916\u63d2\u503c\u8ba1\u7b97\u7684\u9884\u6d4b\u539f\u7406\u4e5f\u662f\u5982\u6b64\uff0c\u53ea\u4e0d\u8fc7\u7a0d\u5fae\u590d\u6742\u70b9\u3002<br \/>\n\u8fd9\u91cc\u6211\u4eec\u6765\u7b80\u5355\u5206\u6790\u4e0b\uff0c\u9996\u5148\u662fMB\u7684\u5212\u5206\uff0c\u62c6\u5206\u62108 x 8\uff0c\u91cc\u9762\u518d\u62c6\u5206\u62104 x 4\uff0c\u5904\u7406\u7684\u987a\u5e8f\u5c31\u662f\u5148\u5bf9\u7b2c1\u4e2a8 x 8\u5757\u91cc\u9762\u76844\u4e2a4 x 4\u5757\u6309\u7167\u5149\u6805\u987a\u5e8f\u5904\u7406\uff0c\u7136\u540e\u5bf9\u7b2c2\u4e2a8 x 8\u5757\u8fdb\u884c\u5904\u7406\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff0c<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10661245606\/\" title=\"h-264-16-x-16-8-x-8-4-x-4-hierarchy by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm6.staticflickr.com\/5535\/10661245606_b5c50f0560_o.jpg\" width=\"3264\" height=\"2448\" alt=\"h-264-16-x-16-8-x-8-4-x-4-hierarchy\"><\/a><br \/>\n\u90a3\u4e48\u5bf9\u67d0\u4e2a\u5177\u4f53\u76844 x 4\u5757\u9884\u6d4b\u7684\u65f6\u5019\u5c31\u597d\u529e\u4e86\uff0c\u6bd4\u5982\u6211\u4eec\u4ee5Horizontal Up\u4e3a\u4f8b\u5b50\uff0c\u53c2\u7167SPEC 8.3.1.2.9 Specification of Intra_4x4_Horizontal_Up prediction mode\uff0c\u622a\u56fe\u5982\u4e0b\uff0c<br \/>\n<a href=\"https:\/\/www.flickr.com\/photos\/46848122@N08\/10661369216\/\" title=\"4-x-4-intra-prediction-modes-horizontal-up by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm8.staticflickr.com\/7344\/10661369216_15d3e8e262_o.png\" width=\"1000\" height=\"781\" alt=\"4-x-4-intra-prediction-modes-horizontal-up\"><\/a><br \/>\n\u8fd9\u5c31\u662f\u6211\u4eec\u9884\u6d4b\u7684\u516c\u5f0f\uff0c\u5f53\u4e2dp[-1, y]\u5c31\u662f\u6211\u4eec\u7528\u6765\u9884\u6d4b\u7684\u50cf\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u7684\u8bdd\uff0c\u662f\u4e0d\u80fd\u5b8c\u6210\u8fd9\u79cd\u6a21\u5f0f\u7684\u9884\u6d4b\u7684\u3002\u8fd9\u4e2a\u9884\u6d4b\u516c\u5f0f\u4e5f\u5f88\u5bb9\u6613\u770b\u61c2\uff0cx\u548cy\u5c31\u662f\u4f60\u8981\u9884\u6d4b\u76844 x 4\u5757\u91cc\u9762\u6bcf\u4e2a\u50cf\u7d20\u7684\u5750\u6807\uff0c\u6240\u4ee5\u5b83\u4eec\u8303\u56f4\u53ea\u80fd\u662f0\u81f33\u3002<br \/>\n\u53e6\u5916\u4e0b\u56fe\u6211\u753b\u4e86\u6bd4\u8f83\u5f62\u8c61\u7684\u56fe\u6765\u8bf4\u660e\uff0cp[-1, y]\u5c31\u4ee3\u8868\u8fd9\u91cc\u7684I\uff0cJ\uff0cK\u548cL\uff0c\u540c\u6837\u56fe\u5f62\u7684\u5750\u6807\u91cc\u9762\u7684\u503c\u662f\u4e00\u6837\u7684\uff0c\u56fe\u5f62\u91cc\u9762\u6570\u5b57\u4e00\u6837\u7684\u8868\u793a\u662f\u7528\u540c\u4e00\u4e2a\u516c\u5f0f\u8ba1\u7b97\u51fa\u6765\u7684(\u516c\u5f0f\u4e00\u6837\uff0c\u4ee3\u5165\u503c\u4e0d\u4e00\u6837\uff0c\u6240\u4ee5\u7ed3\u679c\u503c\u4e0d\u540c\uff0c\u53e6\u5916\u8fd9\u79cd\u5185\u90e8\u6807\u8bb0\u7684\u6211\u6ca1\u6709\u753b\u5b8c\u5168\uff0c\u53ea\u662f\u753b\u51fa\u6765\u4e00\u4e2a\u6765\u8bf4\u660e\u8fd9\u79cd\u60c5\u51b5\uff0c\u5c31\u662f\u5750\u6807\u4e3a[1, 0]\u548c[1, 1]\u7684\u4e24\u4e2a\u4f4d\u7f6e)\uff0c\u770b\u56fe\uff0c<br \/>\n<a href=\"http:\/\/www.flickr.com\/photos\/46848122@N08\/10661254796\/\" title=\"h-264-horizontal-up-prediction by DeliberateKids, on Flickr\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/farm4.staticflickr.com\/3671\/10661254796_c2e0a62452_o.jpg\" width=\"3264\" height=\"2448\" alt=\"h-264-horizontal-up-prediction\"><\/a><br \/>\nJM\u7684\u4ee3\u7801\u4e5f\u6709\u6bd4\u8f83\u76f4\u89c2\u7684\u5c55\u793a\uff0c<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n  case  HOR_UP_PRED:\/* diagonal prediction -22.5 deg to horizontal plane *\/\r\n    if (!block_available_left)\r\n      printf (&quot;warning: Intra_4x4_Horizontal_Up prediction mode not allowed at mb %d\\n&quot;,img-&gt;current_mb_nr);\r\n\r\n\t\/\/ \u4e00\u4e2aMB\u4f1a\u88ab\u62c6\u5206\u621016\u4e2a4 x 4\u7684\u5757(\u5f53\u7136\u5148\u62c6\u5206\u62104\u4e2a8 x 8\u7684\u5757)\uff0c\u4e00\u4e2a4 x 4\u7684\u5757\u53c8\u4f1a\u5305\u542b16\u4e2a\u50cf\u7d20\uff0c\u5c31\u662f\u8fd9\u91cc\r\n\r\n\t\/\/ zHU = x + 2 * y; \/\/ x = 0..3, y = 0..3\r\n\r\n    img-&gt;mpr&#x5B;0+ioff]&#x5B;0+joff] = (P_I + P_J + 1) \/ 2; \/\/ (p&#x5B;\u22121, y + (x &gt;&gt; 1)] + p&#x5B;\u22121, y + (x &gt;&gt; 1) + 1] + 1) &gt;&gt; 1 \u4ee3\u5165 x = 0, y = 0\r\n    img-&gt;mpr&#x5B;1+ioff]&#x5B;0+joff] = (P_I + 2*P_J + P_K + 2) \/ 4; \/\/ (p&#x5B;\u22121, y + (x &gt;&gt; 1)] + 2 * p&#x5B;\u22121, y + (x &gt;&gt; 1) + 1] + p&#x5B;\u22121, y + (x &gt;&gt; 1) + 2] + 2) &gt;&gt; 2 \/\/ \u4ee3\u5165 x = 1, y = 0 \u6ce8\u610fright shift\r\n    img-&gt;mpr&#x5B;2+ioff]&#x5B;0+joff] = \r\n    img-&gt;mpr&#x5B;0+ioff]&#x5B;1+joff] = (P_J + P_K + 1) \/ 2;\r\n    img-&gt;mpr&#x5B;3+ioff]&#x5B;0+joff] = \r\n    img-&gt;mpr&#x5B;1+ioff]&#x5B;1+joff] = (P_J + 2*P_K + P_L + 2) \/ 4;\r\n    img-&gt;mpr&#x5B;2+ioff]&#x5B;1+joff] = \r\n    img-&gt;mpr&#x5B;0+ioff]&#x5B;2+joff] = (P_K + P_L + 1) \/ 2;\r\n    img-&gt;mpr&#x5B;3+ioff]&#x5B;1+joff] = \r\n    img-&gt;mpr&#x5B;1+ioff]&#x5B;2+joff] = (P_K + 2*P_L + P_L + 2) \/ 4;\r\n    img-&gt;mpr&#x5B;3+ioff]&#x5B;2+joff] = \r\n    img-&gt;mpr&#x5B;1+ioff]&#x5B;3+joff] = \r\n    img-&gt;mpr&#x5B;0+ioff]&#x5B;3+joff] = \r\n    img-&gt;mpr&#x5B;2+ioff]&#x5B;2+joff] = \r\n    img-&gt;mpr&#x5B;2+ioff]&#x5B;3+joff] = \r\n    img-&gt;mpr&#x5B;3+ioff]&#x5B;3+joff] = P_L; \/\/ p&#x5B; \u22121, 3 ]\r\n    break;\r\n<\/pre>\n<p>\u8fd9\u5c31\u662fHorizontal Up\u9884\u6d4b\uff0c\u5e94\u8be5\u5c31\u6709\u4e86\u6bd4\u8f83\u900f\u5f7b\u7684\u7406\u89e3\u3002\u8fd9\u7167\u76f8\u673a\u62cd\u7684\u56fe\u5728\u8fd9\u91cc\u663e\u793a\u7684orientation\u4e0d\u5bf9\uff0c\u76f4\u63a5\u70b9\u8fc7\u53bb\u770b\u5927\u56fe\u5427\uff0c\u5927\u56fe\u662f\u6b63\u786e\u7684\u3002<\/p>\n<p>THAVCS\u5f53\u4e2d\u5173\u4e8eLoop filter\u7684 \u63cf\u8ff0\u3002<br \/>\nA filter is applied to every decoded macroblock to reduce blocking distortion [iv]. The de-<br \/>\nblocking filter is applied after the inverse transform in the encoder before reconstructing and<br \/>\nstoring the macroblock for future predictions and in the decoder before reconstructing and<br \/>\ndisplaying the macroblock.<\/p>\n<p>Intra-coded macroblocks are filtered, but intra prediction (section 6.3) is carried out using unfiltered reconstructed<br \/>\nmacroblocks to form the prediction.<\/p>\n<p>CodecVisa\u8f6f\u4ef6\u4e2dPre-LP\u8868\u793aLoop filter\u52a8\u4f5c\u4e4b\u524d\u7684\u6570\u636e\uff0cIDCT Coefficient\u8868\u793aInverse DCT Coefficient\u3002<\/p>\n<p>\u5728JM\u7684ldecod\u548clencod\u5f53\u4e2d\u4f1a\u6709\u4e0e\u9884\u6d4b\u76f8\u5173\u7684\u4ee3\u7801\uff0c\u8be6\u89c1block.c\u5f53\u4e2d\u540d\u5b57\u4ee5intrapred\u6253\u5934\u7684\u65b9\u6cd5\uff0c\u5404\u79cd\u9884\u6d4b\u6a21\u5f0f\u7684\u7b97\u6cd5\u90fd\u6709\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u662f\u4e00\u7bc7\u9605\u8bfb\u7b14\u8bb0\uff0c\u76f4\u63a5\u70b9\u51fb\u56fe\u7247\u53ef\u4ee5\u67e5\u770b\u6e05\u6670\u5927\u56fe\u3002 \u53c2\u8003\u8d44\u6599 The H.264 Advanced Video Compression Standard, Second Edition\uff0c\u4ee5\u4e0b\u7b80\u79f0THAVCS Information technology &#8211; Coding of audio-visual objects &#8211; Part 10: Advanced Video Coding\uff0c\u4ee5\u4e0b\u7b80\u79f0SPEC CodecVisa JM foreman_part_qcif.264 \u8fd9\u4e2a\u662fforeman_part_qcif.yuv\u901a\u8fc7JM 8.6\u8f6c\u6362\u6765\u7684 http:\/\/blog.csdn.net\/stpeace\/article\/details\/8114826 \u7b80\u5355\u7684\u7406\u89e3\u5e27\u5185\u9884\u6d4b\u5c31\u662f\u5229\u7528\u8be5\u5e27\u91cc\u9762\u5df2\u7ecf\u7f16\u7801\u548c\u91cd\u6784\u597d\u7684\u5757\u6765\u7f16\u7801\u6570\u636e\uff0c\u5177\u4f53\u505a\u6cd5\u5c31\u662f\u7528\u5f53\u524d\u5757\u51cf\u53bb\u9884\u6d4b\u5757\uff0c\u5f97\u5230\u7684\u6570\u636e\u518d\u7f16\u7801 \u6bd4\u5982: \u7f16\u7801\u597d\u7684\u5757 B \u9884\u6d4b\u5757 P \u5f53\u524d\u5757 C Delta = C &#8211; P P\u662f\u6839\u636eB\u9884\u6d4b\u6765\u7684\uff0cDelta\u662f\u6700\u7ec8\u8fdb\u884c\u7f16\u7801\u7684\u6570\u636e\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u7ecf\u5e38\u8bf4\u7684Residual \u5bf9\u4e8e\u4eae\u5ea6\u5206\u91cf\uff0cP\u4e00\u822c\u662f4 x 4\u7684\u5757\u6216\u800516 x 16\u7684\u5b8f\u5757(8 x 8\u7684\u53ea\u5728high profile\u5f53\u4e2d\u51fa\u73b0)\uff0c\u5bf9\u4e8e\u7ec6\u8282\u6bd4\u8f83\u4e30\u5bcc\u7684\u5730\u65b9\u4f7f\u75284 x 4\u7684\u5757\uff0c\u5bf9\u4e8e\u6bd4\u8f83\u5e73\u5766\u7684\u5730\u65b9\u4f7f\u752816 x 16\u7684\u5757\u7684(\u8fd9\u6837\u505a\u7684\u539f\u56e0\u5c31\u662f\u901a\u5e38\u5757\u5206\u7684\u8d8a\u7ec6\u5c31\u9700\u8981\u8d8a\u591a\u7684\u4f4d\u6765\u5b58\u653e\u8fd9\u4e9b\u5757\u81ea\u8eab\u7684\u4fe1\u606f\uff0c\u4f46\u9884\u6d4b\u7684\u6b98\u5dee\u4f1a\u6bd4\u8f83\u5c0f\uff1b\u5757\u5206\u7684\u8d8a\u5927\uff0c\u5b58\u653e\u5757\u672c\u8eab\u4fe1\u606f\u6240\u5360\u7528\u6bd4\u8f83\u5c11\u7684\u4f4d\uff0c\u9884\u6d4b\u7684\u65f6\u5019\u6b98\u5dee\u5c31\u4f1a\u5360\u7528\u66f4\u591a\u7684\u4f4d\uff0c\u6240\u4ee5\u8fd9\u662f\u4e00\u4e2a\u6743\u8861)\u3002\u5e76\u4e14\u6211\u4eec\u4e00\u822c\u8bb0\u4f5c4 &hellip; <a href=\"https:\/\/guoh.ai\/lifelog\/2013\/11\/h-264-intra-prediction\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">H.264\u9884\u6d4b\u4e4b\u5e27\u5185\u9884\u6d4b<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_gfmr_meta_descriptions":[],"_gfmr_multilingual_taxonomy_terms":[],"footnotes":""},"categories":[34],"tags":[],"class_list":["post-823","post","type-post","status-publish","format-standard","hentry","category-multimedia"],"_links":{"self":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/comments?post=823"}],"version-history":[{"count":10,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/823\/revisions"}],"predecessor-version":[{"id":826,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/posts\/823\/revisions\/826"}],"wp:attachment":[{"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/media?parent=823"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/categories?post=823"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guoh.ai\/lifelog\/wp-json\/wp\/v2\/tags?post=823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}