Changeset fed3713 in git


Ignore:
Timestamp:
17/06/11 07:33:13 (8 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/trunk, travis-osx
Children:
6ed625e
Parents:
9e516d0d
Message:

src/moviemaker.cc: Simplify the loop to flip the image vertically.

git-svn-id: file:///home/survex-svn/survex/trunk@3620 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r9e516d0d rfed3713  
     1Fri Jun 17 06:32:50 GMT 2011  Olly Betts <olly@survex.com>
     2
     3        * src/moviemaker.cc: Simplify the loop to flip the image vertically.
     4
    15Fri Jun 17 06:17:20 GMT 2011  Olly Betts <olly@survex.com>
    26
  • src/moviemaker.cc

    r9e516d0d rfed3713  
    268268
    269269    int len = 3 * c->width;
    270     const int h = c->height;
    271     // Flip image vertically
    272     unsigned char * src = pixels + h * len;
    273     unsigned char * dest = src - len;
    274     for (int y = 0; y < h; ++y) {
    275         memcpy(dest, src, len);
    276         src += len;
    277         dest -= len;
     270    {
     271        // Flip image vertically
     272        int h = c->height;
     273        unsigned char * src = pixels + h * len;
     274        unsigned char * dest = src - len;
     275        while (h--) {
     276            memcpy(dest, src, len);
     277            src += len;
     278            dest -= len;
     279        }
    278280    }
    279281    sws_scale(sws_ctx, &pixels, &len, 0, c->height, frame->data, frame->linesize);
Note: See TracChangeset for help on using the changeset viewer.