如何旋转YUV420数据?

编程入门 行业动态 更新时间:2024-10-22 19:43:18
本文介绍了如何旋转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.

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

    本文发布于:2023-11-30 20:38:13,感谢您对本站的认可!
    本文链接:https://www.elefans.com/category/jswz/34/1651407.html
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:数据

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!