michael@0: /******************************************************************** michael@0: * * michael@0: * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * michael@0: * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * michael@0: * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * michael@0: * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * michael@0: * * michael@0: * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * michael@0: * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * michael@0: * * michael@0: ******************************************************************** michael@0: michael@0: function: michael@0: last mod: $Id: fragment.c 17410 2010-09-21 21:53:48Z tterribe $ michael@0: michael@0: ********************************************************************/ michael@0: #include michael@0: #include "internal.h" michael@0: michael@0: void oc_frag_copy_c(unsigned char *_dst,const unsigned char *_src,int _ystride){ michael@0: int i; michael@0: for(i=8;i-->0;){ michael@0: memcpy(_dst,_src,8*sizeof(*_dst)); michael@0: _dst+=_ystride; michael@0: _src+=_ystride; michael@0: } michael@0: } michael@0: michael@0: /*Copies the fragments specified by the lists of fragment indices from one michael@0: frame to another. michael@0: _dst_frame: The reference frame to copy to. michael@0: _src_frame: The reference frame to copy from. michael@0: _ystride: The row stride of the reference frames. michael@0: _fragis: A pointer to a list of fragment indices. michael@0: _nfragis: The number of fragment indices to copy. michael@0: _frag_buf_offs: The offsets of fragments in the reference frames.*/ michael@0: void oc_frag_copy_list_c(unsigned char *_dst_frame, michael@0: const unsigned char *_src_frame,int _ystride, michael@0: const ptrdiff_t *_fragis,ptrdiff_t _nfragis,const ptrdiff_t *_frag_buf_offs){ michael@0: ptrdiff_t fragii; michael@0: for(fragii=0;fragii<_nfragis;fragii++){ michael@0: ptrdiff_t frag_buf_off; michael@0: frag_buf_off=_frag_buf_offs[_fragis[fragii]]; michael@0: oc_frag_copy_c(_dst_frame+frag_buf_off, michael@0: _src_frame+frag_buf_off,_ystride); michael@0: } michael@0: } michael@0: michael@0: void oc_frag_recon_intra_c(unsigned char *_dst,int _ystride, michael@0: const ogg_int16_t _residue[64]){ michael@0: int i; michael@0: for(i=0;i<8;i++){ michael@0: int j; michael@0: for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+128); michael@0: _dst+=_ystride; michael@0: } michael@0: } michael@0: michael@0: void oc_frag_recon_inter_c(unsigned char *_dst, michael@0: const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){ michael@0: int i; michael@0: for(i=0;i<8;i++){ michael@0: int j; michael@0: for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+_src[j]); michael@0: _dst+=_ystride; michael@0: _src+=_ystride; michael@0: } michael@0: } michael@0: michael@0: void oc_frag_recon_inter2_c(unsigned char *_dst,const unsigned char *_src1, michael@0: const unsigned char *_src2,int _ystride,const ogg_int16_t _residue[64]){ michael@0: int i; michael@0: for(i=0;i<8;i++){ michael@0: int j; michael@0: for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+(_src1[j]+_src2[j]>>1)); michael@0: _dst+=_ystride; michael@0: _src1+=_ystride; michael@0: _src2+=_ystride; michael@0: } michael@0: } michael@0: michael@0: void oc_restore_fpu_c(void){}