/src/mozilla-central/media/libtheora/lib/fragment.c
Line | Count | Source (jump to first uncovered line) |
1 | | /******************************************************************** |
2 | | * * |
3 | | * THIS FILE IS PART OF THE OggTheora SOFTWARE CODEC SOURCE CODE. * |
4 | | * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * |
5 | | * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * |
6 | | * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * |
7 | | * * |
8 | | * THE Theora SOURCE CODE IS COPYRIGHT (C) 2002-2009 * |
9 | | * by the Xiph.Org Foundation and contributors http://www.xiph.org/ * |
10 | | * * |
11 | | ******************************************************************** |
12 | | |
13 | | function: |
14 | | last mod: $Id: fragment.c 17410 2010-09-21 21:53:48Z tterribe $ |
15 | | |
16 | | ********************************************************************/ |
17 | | #include <string.h> |
18 | | #include "internal.h" |
19 | | |
20 | 0 | void oc_frag_copy_c(unsigned char *_dst,const unsigned char *_src,int _ystride){ |
21 | 0 | int i; |
22 | 0 | for(i=8;i-->0;){ |
23 | 0 | memcpy(_dst,_src,8*sizeof(*_dst)); |
24 | 0 | _dst+=_ystride; |
25 | 0 | _src+=_ystride; |
26 | 0 | } |
27 | 0 | } |
28 | | |
29 | | /*Copies the fragments specified by the lists of fragment indices from one |
30 | | frame to another. |
31 | | _dst_frame: The reference frame to copy to. |
32 | | _src_frame: The reference frame to copy from. |
33 | | _ystride: The row stride of the reference frames. |
34 | | _fragis: A pointer to a list of fragment indices. |
35 | | _nfragis: The number of fragment indices to copy. |
36 | | _frag_buf_offs: The offsets of fragments in the reference frames.*/ |
37 | | void oc_frag_copy_list_c(unsigned char *_dst_frame, |
38 | | const unsigned char *_src_frame,int _ystride, |
39 | 0 | const ptrdiff_t *_fragis,ptrdiff_t _nfragis,const ptrdiff_t *_frag_buf_offs){ |
40 | 0 | ptrdiff_t fragii; |
41 | 0 | for(fragii=0;fragii<_nfragis;fragii++){ |
42 | 0 | ptrdiff_t frag_buf_off; |
43 | 0 | frag_buf_off=_frag_buf_offs[_fragis[fragii]]; |
44 | 0 | oc_frag_copy_c(_dst_frame+frag_buf_off, |
45 | 0 | _src_frame+frag_buf_off,_ystride); |
46 | 0 | } |
47 | 0 | } |
48 | | |
49 | | void oc_frag_recon_intra_c(unsigned char *_dst,int _ystride, |
50 | 0 | const ogg_int16_t _residue[64]){ |
51 | 0 | int i; |
52 | 0 | for(i=0;i<8;i++){ |
53 | 0 | int j; |
54 | 0 | for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+128); |
55 | 0 | _dst+=_ystride; |
56 | 0 | } |
57 | 0 | } |
58 | | |
59 | | void oc_frag_recon_inter_c(unsigned char *_dst, |
60 | 0 | const unsigned char *_src,int _ystride,const ogg_int16_t _residue[64]){ |
61 | 0 | int i; |
62 | 0 | for(i=0;i<8;i++){ |
63 | 0 | int j; |
64 | 0 | for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+_src[j]); |
65 | 0 | _dst+=_ystride; |
66 | 0 | _src+=_ystride; |
67 | 0 | } |
68 | 0 | } |
69 | | |
70 | | void oc_frag_recon_inter2_c(unsigned char *_dst,const unsigned char *_src1, |
71 | 0 | const unsigned char *_src2,int _ystride,const ogg_int16_t _residue[64]){ |
72 | 0 | int i; |
73 | 0 | for(i=0;i<8;i++){ |
74 | 0 | int j; |
75 | 0 | for(j=0;j<8;j++)_dst[j]=OC_CLAMP255(_residue[i*8+j]+(_src1[j]+_src2[j]>>1)); |
76 | 0 | _dst+=_ystride; |
77 | 0 | _src1+=_ystride; |
78 | 0 | _src2+=_ystride; |
79 | 0 | } |
80 | 0 | } |
81 | | |
82 | 0 | void oc_restore_fpu_c(void){} |