Code Monkey home page Code Monkey logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 8, 2024
Note on this line: src_uplane + (width * height / 4);
it wont be quite right for odd width/height.
best to compute
int half_width = (width + 1) / 2;
int half_height = (height + 1) / 2;
unsigned char * src_vplane = src_uplane + half_width * half_height;

The main issue is you're passing src as destination.  Unfortunately I didn't 
anticipate that one and it won't work in the current code.

The way the function works internally is it writes each row of destination, 
starting at the top left, with a horizontally mirrored row, starting the reads 
at the last row.
It would be difficult to make 90 and 270 degree rotation work, but it would be 
possible to make 180 work, if it swapped 2 rows at a time.

Original comment by [email protected] on 28 Mar 2012 at 12:28

  • Changed state: Started

from libyuv.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 8, 2024
r227 adds I420Rotate by 180 in place

1. ConvertToI420 now has the ability to rotate anything (ie MJPG) using a 
temporary buffer.  So it was easy to add a check for destination==source and 
use the buffer to allow rotate to work 'in-place'.  But it wont really be 
inplace.

2. I420Rotate does 2 rows at a time, swapping them and mirroring.
Performance is only marginally slower, but more flexible, so I always use the 
new approach for better code coverage.

Before:
ConstructI420Rotate0 (455 ms)
ConstructI420Rotate90 (921 ms)
ConstructI420Rotate180 (425 ms)
ConstructI420Rotate270 (922 ms)

After
ConstructI420Rotate0 (460 ms)
ConstructI420Rotate90 (917 ms)
ConstructI420Rotate180 (461 ms)
ConstructI420Rotate270 (911 ms)

Original comment by [email protected] on 28 Mar 2012 at 3:03

from libyuv.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 8, 2024

Original comment by [email protected] on 28 Mar 2012 at 8:05

  • Changed state: Fixed

from libyuv.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 8, 2024
r247 fixes a Neon rotate issue.

Original comment by [email protected] on 22 Apr 2012 at 3:08

from libyuv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.