[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 1741, Sun Oct 29 08:04:02 2006 UTC revision 1742, Mon Oct 30 10:52:00 2006 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: colorspace.c,v 1.12 2006-10-29 08:04:02 chl Exp $   * $Id: colorspace.c,v 1.13 2006-10-30 10:52:00 Skal Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 472  Line 472 
472          int width2 = width / 2;          int width2 = width / 2;
473          int height2 = height / 2;          int height2 = height / 2;
474          int y;          int y;
475            const int with_uv = (u_src!=0 && v_src!=0);
476    
477          if (vflip) {          if (vflip) {
478                  y_src += (height - 1) * y_src_stride;                  y_src += (height - 1) * y_src_stride;
479                    if (with_uv) {
480                  u_src += (height2 - 1) * uv_src_stride;                  u_src += (height2 - 1) * uv_src_stride;
481                  v_src += (height2 - 1) * uv_src_stride;                  v_src += (height2 - 1) * uv_src_stride;
482                    }
483                  y_src_stride = -y_src_stride;                  y_src_stride = -y_src_stride;
484                  uv_src_stride = -uv_src_stride;                  uv_src_stride = -uv_src_stride;
485          }          }
# Line 487  Line 490 
490                  y_dst += y_dst_stride;                  y_dst += y_dst_stride;
491          }          }
492    
493          if (u_src)          if (with_uv) {
494                  for (y = height2; y; y--) {                  for (y = height2; y; y--) {
495                          memcpy(u_dst, u_src, width2);                          memcpy(u_dst, u_src, width2);
496                            memcpy(v_dst, v_src, width2);
497                          u_src += uv_src_stride;                          u_src += uv_src_stride;
498                          u_dst += uv_dst_stride;                          u_dst += uv_dst_stride;
                 }  
         else  
                 for (y = height2; y; y--) {  
                         memset(u_dst, 0x80, width2);  
                         u_dst += uv_dst_stride;  
                 }  
   
         if (v_src)  
                 for (y = height2; y; y--) {  
                         memcpy(v_dst, v_src, width2);  
499                          v_src += uv_src_stride;                          v_src += uv_src_stride;
500                          v_dst += uv_dst_stride;                          v_dst += uv_dst_stride;
501                  }                  }
502          else          }
503            else {
504                  for (y = height2; y; y--) {                  for (y = height2; y; y--) {
505                            memset(u_dst, 0x80, width2);
506                          memset(v_dst, 0x80, width2);                          memset(v_dst, 0x80, width2);
507                            u_dst += uv_dst_stride;
508                          v_dst += uv_dst_stride;                          v_dst += uv_dst_stride;
509                  }                  }
510  }  }
511    }
512    
513    
514    

Legend:
Removed from v.1741  
changed lines
  Added in v.1742

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