[svn] / trunk / xvidcore / src / image / colorspace.c Repository:
ViewVC logotype

Diff of /trunk/xvidcore/src/image/colorspace.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 676, Mon Nov 25 13:38:56 2002 UTC revision 677, Tue Nov 26 23:44:11 2002 UTC
# Line 51  Line 51 
51   *  exception also makes it possible to release a modified version which   *  exception also makes it possible to release a modified version which
52   *  carries forward this exception.   *  carries forward this exception.
53   *   *
54   * $Id: colorspace.c,v 1.6 2002-11-17 00:20:30 edgomez Exp $   * $Id: colorspace.c,v 1.7 2002-11-26 23:44:10 edgomez Exp $
55   *   *
56   ****************************************************************************/   ****************************************************************************/
57    
58  #include <string.h>                             // memcpy  #include <string.h>                             /* memcpy */
59    
60  #include "colorspace.h"  #include "colorspace.h"
61  #include "../divx4.h"                   // DEC_PICTURE  #include "../divx4.h"                   /* DEC_PICTURE */
62    
63  // function pointers  /* function pointers */
64    
65  /* input */  /* input */
66  color_inputFuncPtr rgb555_to_yv12;  color_inputFuncPtr rgb555_to_yv12;
# Line 142  Line 142 
142    
143    
144          for (y = height / 2; y; y--) {          for (y = height / 2; y; y--) {
145                  // process one 2x2 block per iteration                  /* process one 2x2 block per iteration */
146                  for (x = 0; x < (uint32_t) width; x += 2) {                  for (x = 0; x < (uint32_t) width; x += 2) {
147                          int rgb, r, g, b, r4, g4, b4;                          int rgb, r, g, b, r4, g4, b4;
148    
# Line 227  Line 227 
227    
228    
229          for (y = height / 2; y; y--) {          for (y = height / 2; y; y--) {
230                  // process one 2x2 block per iteration                  /* process one 2x2 block per iteration */
231                  for (x = 0; x < (uint32_t) width; x += 2) {                  for (x = 0; x < (uint32_t) width; x += 2) {
232                          int rgb, r, g, b, r4, g4, b4;                          int rgb, r, g, b, r4, g4, b4;
233    
# Line 499  Line 499 
499    
500                  for (x = width >> 1; x; x--) {                  for (x = width >> 1; x; x--) {
501                          *y_out++ = *src++;                          *y_out++ = *src++;
502                          //*u_out++ = *src++;                          /**u_out++ = *src++; */
503                          *u_out++ = (*(src + width2) + *src) >> 1;                          *u_out++ = (*(src + width2) + *src) >> 1;
504                          src++;                          src++;
505                          *y_out++ = *src++;                          *y_out++ = *src++;
506                          //*v_out++ = *src++;                          /**v_out++ = *src++; */
507                          *v_out++ = (*(src + width2) + *src) >> 1;                          *v_out++ = (*(src + width2) + *src) >> 1;
508                          src++;                          src++;
509    
# Line 551  Line 551 
551    
552                  for (x = width >> 1; x; x--) {                  for (x = width >> 1; x; x--) {
553                          *u_out++ = *src++;                          *u_out++ = *src++;
554                          // *u_out++ = (*(src+width2) + *src++) >> 1;                          /* *u_out++ = (*(src+width2) + *src++) >> 1; */
555                          *y_out++ = *src++;                          *y_out++ = *src++;
556                          //*v_out++ = *src++;                          /**v_out++ = *src++; */
557                          *v_out++ = (*(src + width2) + *src) >> 1;                          *v_out++ = (*(src + width2) + *src) >> 1;
558                          src++;                          src++;
559                          *y_out++ = *src++;                          *y_out++ = *src++;
# Line 652  Line 652 
652                  r = g = b = 0;                  r = g = b = 0;
653                  r2 = g2 = b2 = 0;                  r2 = g2 = b2 = 0;
654    
655                  // process one 2x2 block per iteration                  /* process one 2x2 block per iteration */
656                  for (x = 0; x < (uint32_t) width / 2; x++) {                  for (x = 0; x < (uint32_t) width / 2; x++) {
657                          int u, v;                          int u, v;
658                          int b_u, g_uv, r_v, rgb_y;                          int b_u, g_uv, r_v, rgb_y;
# Line 734  Line 734 
734          uint8_t *y_src2 = y_src + y_stride;          uint8_t *y_src2 = y_src + y_stride;
735          uint32_t x, y;          uint32_t x, y;
736    
737          if (height < 0) {                       // flip image?          if (height < 0) {                       /* flip image? */
738                  height = -height;                  height = -height;
739                  y_src += (height - 1) * y_stride;                  y_src += (height - 1) * y_stride;
740                  y_src2 = y_src - y_stride;                  y_src2 = y_src - y_stride;
# Line 751  Line 751 
751                  r = g = b = 0;                  r = g = b = 0;
752                  r2 = g2 = b2 = 0;                  r2 = g2 = b2 = 0;
753    
754                  // process one 2x2 block per iteration                  /* process one 2x2 block per iteration */
755                  for (x = 0; x < (uint32_t) width / 2; x++) {                  for (x = 0; x < (uint32_t) width / 2; x++) {
756                          int u, v;                          int u, v;
757                          int b_u, g_uv, r_v, rgb_y;                          int b_u, g_uv, r_v, rgb_y;
# Line 828  Line 828 
828          uint8_t *y_src2 = y_src + y_stride;          uint8_t *y_src2 = y_src + y_stride;
829          uint32_t x, y;          uint32_t x, y;
830    
831          if (height < 0) {                       // flip image?          if (height < 0) {                       /* flip image? */
832                  height = -height;                  height = -height;
833                  y_src += (height - 1) * y_stride;                  y_src += (height - 1) * y_stride;
834                  y_src2 = y_src - y_stride;                  y_src2 = y_src - y_stride;
# Line 839  Line 839 
839          }          }
840    
841          for (y = height / 2; y; y--) {          for (y = height / 2; y; y--) {
842                  // process one 2x2 block per iteration                  /* process one 2x2 block per iteration */
843                  for (x = 0; x < (uint32_t) width / 2; x++) {                  for (x = 0; x < (uint32_t) width / 2; x++) {
844                          int u, v;                          int u, v;
845                          int b_u, g_uv, r_v, rgb_y;                          int b_u, g_uv, r_v, rgb_y;
# Line 925  Line 925 
925          uint8_t *y_src2 = y_src + y_stride;          uint8_t *y_src2 = y_src + y_stride;
926          uint32_t x, y;          uint32_t x, y;
927    
928          if (height < 0) {                       // flip image?          if (height < 0) {                       /* flip image? */
929                  height = -height;                  height = -height;
930                  y_src += (height - 1) * y_stride;                  y_src += (height - 1) * y_stride;
931                  y_src2 = y_src - y_stride;                  y_src2 = y_src - y_stride;
# Line 936  Line 936 
936          }          }
937    
938          for (y = height / 2; y; y--) {          for (y = height / 2; y; y--) {
939                  // process one 2x2 block per iteration                  /* process one 2x2 block per iteration */
940                  for (x = 0; x < (uint32_t) width / 2; x++) {                  for (x = 0; x < (uint32_t) width / 2; x++) {
941                          int u, v;                          int u, v;
942                          int b_u, g_uv, r_v, rgb_y;                          int b_u, g_uv, r_v, rgb_y;

Legend:
Removed from v.676  
changed lines
  Added in v.677

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4