Main Page | Namespace List | Compound List | File List | Compound Members | File Members

upscale.cc

Go to the documentation of this file.
00001 /*--------------------------------------------------------------------
00002  *
00003  * (C) Copyright Koninklijke Philips Electronics NV 2006. 
00004  * All rights reserved. This software is licensed under the terms of
00005  * version 2.1 of the GNU Lesser General Public License as published 
00006  * by the Free Software Foundation. For licensing and warranty
00007  * information, see the file COPYING in the main directory.
00008  *
00009  *------------------------------------------------------------------*/
00010 
00011 #include "upscale.h"
00012 
00013 /* The number of bits coefficients are scaled up before 2-D IDCT: */
00014 
00015 const unsigned int S_BITS = 3;
00016 
00017 inline
00018 VYApixel SCALE(VYApixel x, unsigned int n)
00019 {
00020   return x << n;
00021 }
00022 
00023 UpScale::UpScale(
00024   const Id&   n, 
00025   In<VYApixel>&   ci, 
00026   Out<VYApixel>&  co)
00027 :
00028       Process(n),
00029       CIn(  id("CIn"),  ci),
00030       COut( id("COut"), co)
00031 {
00032 }
00033 
00034 void UpScale::main()
00035 {
00036   VYApixel pixelIn;
00037   VYApixel pixelOut;
00038 
00039   while (true)
00040       {
00041     read(CIn, pixelIn);
00042     pixelOut = SCALE(pixelIn, S_BITS);
00043     write(COut, pixelOut);
00044   }
00045 }

Generated on Wed Feb 15 14:52:45 2006 for jpegdec by doxygen 1.3.2