Changeset 4682

Show
Ignore:
Timestamp:
03/11/10 14:55:01 (4 years ago)
Author:
soohyunc
Message:

-- framebase_ is composed of Y size + (U + V) size.

(it's more straightforward to understand than before)

actually, set_size_411 is wrong - instead, it should be YUV420.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • vic/branches/cc/video/grabber.cpp

    r4152 r4682  
    170170        double dslope = 219. / (dmax - dmin) * c; 
    171171        double dy = 16.; 
    172         int i; 
     172        u_int i; 
    173173        for (i = 0; i < min; ++i) 
    174174                ynorm_[i] = u_char(dy); 
     
    435435        int s = w * h; 
    436436        framesize_ = s; 
    437         int n = s + (s >> 1) + 2 * GRABBER_VPAD * outw_; 
    438         framebase_ = new u_char[n]; 
    439         /* initialize to gray */ 
    440         memset(framebase_, 0x80, n); 
     437        int ny = s + GRABBER_VPAD * outw_;      // Y size 
     438        int nuv = (s >> 1) + GRABBER_VPAD * outw_;      // U + V size 
     439        framebase_ = new u_char[ny + nuv]; 
     440        /* initialize to black */ 
     441        memset(framebase_, 0, ny); 
     442        memset(framebase_ + ny, 0x80, nuv); 
    441443        frame_ = framebase_ + GRABBER_VPAD * outw_; 
    442444        crinit(w, h);