Changeset 1104
- Timestamp:
- 03/26/11 21:40:07 (2 years ago)
- File:
-
- 1 edited
-
trunk/core/histogram.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/histogram.c
r1024 r1104 61 61 } 62 62 63 // Define how many viewport blocks to step in each loop iteration. Each block is 6 bytes (UYVYYY) or 4 image pixels 64 #define HISTO_STEP_SIZE 6 65 63 66 void histogram_process() 64 67 { … … 66 69 int i, hi, c; 67 70 int y, v, u; 68 static int x , img_offset;71 static int x; 69 72 static int viewport_size; 70 73 unsigned int histo_fill[5]; … … 77 80 img = vid_get_viewport_fb(); 78 81 } 79 img _offset= vid_get_viewport_image_offset(); // offset into viewport for when image size != viewport size (e.g. 16:9 image on 4:3 LCD)82 img += vid_get_viewport_image_offset(); // offset into viewport for when image size != viewport size (e.g. 16:9 image on 4:3 LCD) 80 83 viewport_size = vid_get_viewport_height() * vid_get_viewport_buffer_width(); 81 84 for (c=0; c<5; ++c) { … … 92 95 case 2: 93 96 case 3: 94 x = 0; 95 for (i=(histogram_stage-1)*6; i<viewport_size*3; i+= 6*3*2) {96 y = img[i mg_offset+i+1];97 u = *(signed char*)(&img[i mg_offset+i]);97 x = 0; // count how many blocks we have done on the current row (to skip unused buffer space at end of each row) 98 for (i=(histogram_stage-1)*6; i<viewport_size*3; i+=HISTO_STEP_SIZE*6) { 99 y = img[i+1]; 100 u = *(signed char*)(&img[i]); 98 101 if (u&0x00000080) u|=0xFFFFFF00; 99 v = *(signed char*)(&img[i mg_offset+i+2]);102 v = *(signed char*)(&img[i+2]); 100 103 if (v&0x00000080) v|=0xFFFFFF00; 101 104 … … 110 113 111 114 // Handle case where viewport memory buffer is wider than the actual buffer. 112 x ++;115 x += HISTO_STEP_SIZE * 2; // viewport width is measured in blocks of three bytes each even though the data is stored in six byte chunks ! 113 116 if (x == vid_get_viewport_width()) 114 117 {
Note: See TracChangeset
for help on using the changeset viewer.