From 1adeabc57d08400ad6e49a1d091e1548cbc17bc9 Mon Sep 17 00:00:00 2001 From: dezhihuang Date: Wed, 18 Oct 2017 09:34:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0yuv420p=E5=83=8F=E7=B4=A0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=8E=92=E5=88=97=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 +++ images/yuv420p_data.png | Bin 0 -> 4883 bytes 2 files changed, 3 insertions(+) create mode 100644 images/yuv420p_data.png diff --git a/README.md b/README.md index e8b3826..86d68f8 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,9 @@ yuv播放器:[修改了一个YUV/RGB播放器](http://blog.csdn.net/leixiaohua ## 分离YUV420P像素数据中的Y、U、V分量 > 如果视频帧的宽和高分别为w和h,那么一帧YUV420P像素数据一共占用w*h*3/2 Byte的数据。其中前w * h Byte存储Y,接着的w * h * 1/4 Byte存储U,最后w * h * 1/4 Byte存储V。 +yuv420p像素数据排列如下图。原图像分辨率为256 * 256,所以Y分量分辨率为256 * 256,U分量分辨率为128 * 128,V分量分辨率为128 * 128: + +![](./images/yuv420p_data.png) yuv420_split.cpp 程序中的函数可以将YUV420P数据中的Y、U、V三个分量分离开来并保存成三个文件。 diff --git a/images/yuv420p_data.png b/images/yuv420p_data.png new file mode 100644 index 0000000000000000000000000000000000000000..01c27c84c29717fd9b7302b76e346d84598b3c6a GIT binary patch literal 4883 zcmeHL`#TeS8{fQ3WHRI|nx-j<9;YOyHWixb@TeR@P6_kmu#wq_=CG0;A%~Dq9*4|f z&U1`dljEE>u`CMZyk@-qgy)y{r?(&OAMX3QKG%I+pZorNzn|-lx3j${en9a6000oT zx`ez60071IB2h$WuOeYh!2keK<5ozE>!HBKOiJM71u64Z&4`5HD7uSzMATwOe?i)n zSI?cWpFM5g_Vu0$;dF51Ubsxxw+u9Y*O!}UYKrc(M#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