如何旋转YUV420数据? [英] How to rotate yuv420 data?

查看:123
本文介绍了如何旋转YUV420数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要知道如何旋转图像,这是YUV420P格式90度。转换至RGB格式,旋转,再次再转换为YUV的选项是不可行的。即使是一个算法会有所帮助。

I need to know how to rotate an image, which is in yuv420p format by 90 degrees. The option of converting this to rgb, rotating and again reconverting to yuv is not feasible. Even an algorithm would help.

问候, Anirudh。

Regards, Anirudh.

推荐答案

我想这是不是平面YUV ,如果​​它已经是相当容易(跳过第一个和最后一个步骤)。你的意思是有YUV 4:2:0平面的,但我不明白为什么你有困难

I suppose it is not planar YUV, if it is it already it's quite easy (skip first and last steps). You meant to have YUV 4:2:0 planar, but then I do not understand why you have difficulties.

  1. 先将其转换成一个平面:分配空间飞机和投入在正确的地方根据的打包YUV格式你。
  2. 旋转 U V 飞机分别。 颜色( U V )的信息每个块,然后应保持不变。
  3. 重组的飞机reobtain 你必须在正确的打包YUV初
  1. convert it to a planar first: allocate space for planes and put bytes at right places according to the packed YUV format you have.
  2. rotate the Y, U, V planes separately. The "color" (U, V) information for each block then shall be kept the same.
  3. recombine the planes to reobtain the right packed YUV you had at the beginning

这一直工作正常,如果你的图像尺寸是多个4.如果没有,那么照顾......

This always works fine if your image dimensions are multiple of 4. If not, then take care...

这篇关于如何旋转YUV420数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆