summary refs log tree commit diff
path: root/pkgs/development/libraries/dirac/dirac-1.0.2.patch
blob: 3d253b8f6d67086e56aaa452cac143457a08fac4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
diff -aur dirac-1.0.2/libdirac_byteio/parseunit_byteio.cpp dirac-1.0.2-modif/libdirac_byteio/parseunit_byteio.cpp
--- dirac-1.0.2/libdirac_byteio/parseunit_byteio.cpp	2008-05-02 09:57:19.000000000 +0400
+++ dirac-1.0.2-modif/libdirac_byteio/parseunit_byteio.cpp	2016-02-10 19:39:09.838443767 +0300
@@ -124,12 +124,9 @@
 
     if(prefix==PU_PREFIX)
     {
-        unsigned char next_parse_code;
-
-        next_parse_code = InputUnByte();
+        (void)InputUnByte();
         // input next unit parse-offsets
-        int next_unit_next_parse_offset;
-        next_unit_next_parse_offset = ReadUintLit(PU_NEXT_PARSE_OFFSET_SIZE);
+        (void)ReadUintLit(PU_NEXT_PARSE_OFFSET_SIZE);
 
         int next_unit_previous_parse_offset;
         next_unit_previous_parse_offset = ReadUintLit(PU_PREVIOUS_PARSE_OFFSET_SIZE);
diff -aur dirac-1.0.2/libdirac_common/mot_comp.cpp dirac-1.0.2-modif/libdirac_common/mot_comp.cpp
--- dirac-1.0.2/libdirac_common/mot_comp.cpp	2008-10-01 05:26:47.000000000 +0400
+++ dirac-1.0.2-modif/libdirac_common/mot_comp.cpp	2016-02-10 19:50:18.453051800 +0300
@@ -1064,10 +1064,10 @@
         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
 
         //weights for doing linear interpolation, calculated from the remainder values
-        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
-                                           rmdr.x * (2 - rmdr.y),          //tr
-                                           (2 - rmdr.x) * rmdr.y,          //bl
-                                           rmdr.x * rmdr.y };              //br
+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
+                                           ValueType(rmdr.x * rmdr.y) };              //br
 
 
        for(int c = 0, uY = ref_start.y,BuY=BChk(uY,trueRefYlen),BuY1=BChk(uY+1,trueRefYlen);
@@ -1116,10 +1116,10 @@
     const ImageCoords ref_start( ( start_pos.x<<1 ) + roundvec.x ,( start_pos.y<<1 ) + roundvec.y );
 
     //weights for doing linear interpolation, calculated from the remainder values
-    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
-                                    rmdr.x * (4 - rmdr.y),          //tr
-                                    (4 - rmdr.x) * rmdr.y,          //bl
-                                    rmdr.x * rmdr.y };              //br
+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
+                                    ValueType(rmdr.x * (4 - rmdr.y)),          //tr
+                                    ValueType((4 - rmdr.x) * rmdr.y),          //bl
+                                    ValueType(rmdr.x * rmdr.y) };              //br
 
     //An additional stage to make sure the block to be copied does not fall outside
     //the reference image.
diff -aur dirac-1.0.2/libdirac_common/mot_comp_mmx.cpp dirac-1.0.2-modif/libdirac_common/mot_comp_mmx.cpp
--- dirac-1.0.2/libdirac_common/mot_comp_mmx.cpp	2008-01-09 13:50:23.000000000 +0300
+++ dirac-1.0.2-modif/libdirac_common/mot_comp_mmx.cpp	2016-02-10 19:59:51.792793538 +0300
@@ -244,10 +244,10 @@
         // We're 2doing bounds checking because we'll fall off the edge of the reference otherwise.
 
         //weights for doing linear interpolation, calculated from the remainder values
-        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
-                                           rmdr.x * (2 - rmdr.y),          //tr
-                                           (2 - rmdr.x) * rmdr.y,          //bl
-                                           rmdr.x * rmdr.y };              //br
+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
+                                           ValueType(rmdr.x * rmdr.y) };              //br
 
         ValueType act_cols1[4], act_cols2[4];
         int uX, uY, c, l;
diff -aur dirac-1.0.2/libdirac_common/mv_codec.cpp dirac-1.0.2-modif/libdirac_common/mv_codec.cpp
--- dirac-1.0.2/libdirac_common/mv_codec.cpp	2008-10-01 05:26:47.000000000 +0400
+++ dirac-1.0.2-modif/libdirac_common/mv_codec.cpp	2016-02-10 19:51:57.634838245 +0300
@@ -159,7 +159,7 @@
 // Main code function
 void PredModeCodec::DoWorkCode( MvData& in_data )
 {
-    int step,max; 
+    int step; 
     int split_depth;  
 
     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
@@ -169,7 +169,7 @@
             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp]; 
 
             step = 4  >>  (split_depth); 
-            max = (1 << split_depth); 
+            //max = (1 << split_depth); 
                         
             //now do all the block modes and mvs in the mb            
             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
@@ -334,7 +334,7 @@
 // Main code function
 void VectorElementCodec::DoWorkCode( MvData& in_data )
 {
-    int step,max;
+    int step;
     int split_depth;
 
     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
@@ -344,7 +344,7 @@
             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp];
 
             step = 4  >>  (split_depth);
-            max = (1 << split_depth);
+            //max = (1 << split_depth);
                         
             //now do all the block modes and mvs in the mb            
             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
@@ -500,7 +500,7 @@
 // Main code function
 void DCCodec::DoWorkCode( MvData& in_data )
 {
-    int step,max; 
+    int step; 
     int split_depth;  
     
     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
@@ -510,7 +510,7 @@
             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp]; 
 
             step = 4  >>  (split_depth); 
-            max = (1 << split_depth); 
+            //max = (1 << split_depth); 
                         
             //now do all the block modes and mvs in the mb            
             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
diff -aur dirac-1.0.2/libdirac_common/wavelet_utils.cpp dirac-1.0.2-modif/libdirac_common/wavelet_utils.cpp
--- dirac-1.0.2/libdirac_common/wavelet_utils.cpp	2008-10-20 08:21:02.000000000 +0400
+++ dirac-1.0.2-modif/libdirac_common/wavelet_utils.cpp	2016-02-10 19:58:16.205006445 +0300
@@ -198,7 +198,6 @@
     const bool field_coding = encparams.FieldCoding();
     const ChromaFormat cformat = pparams.CFormat();
     const float cpd = encparams.CPD()*cpd_scale_factor;
-    const PictureSort psort = pparams.PicSort();
 
     int xlen, ylen, xl, yl, xp, yp;
     float xfreq, yfreq;
diff -aur dirac-1.0.2/libdirac_encoder/picture_compress.cpp dirac-1.0.2-modif/libdirac_encoder/picture_compress.cpp
--- dirac-1.0.2/libdirac_encoder/picture_compress.cpp	2009-01-21 08:20:57.000000000 +0300
+++ dirac-1.0.2-modif/libdirac_encoder/picture_compress.cpp	2016-02-10 20:08:17.935731263 +0300
@@ -413,14 +413,12 @@
 
         const int depth=m_encparams.TransformDepth();
 
-        PicArray* comp_data[3];
         CoeffArray* coeff_data[3];
         OneDArray<unsigned int>* est_bits[3];
         float lambda[3];
 
         // Construction and definition of objects
         for (int c=0;c<3;++c){
-            comp_data[c] = &my_picture.Data((CompSort) c );
 	    coeff_data[c] = &my_picture.WltData((CompSort) c );
             est_bits[c] =  new OneDArray<unsigned int>( Range( 1, 3*depth+1 ) );
         }// c
diff -aur dirac-1.0.2/libdirac_encoder/quant_chooser.cpp dirac-1.0.2-modif/libdirac_encoder/quant_chooser.cpp
--- dirac-1.0.2/libdirac_encoder/quant_chooser.cpp	2009-01-21 08:22:05.000000000 +0300
+++ dirac-1.0.2-modif/libdirac_encoder/quant_chooser.cpp	2016-02-10 20:15:43.792954708 +0300
@@ -340,7 +340,7 @@
     {
         for (int i=cblock.Xstart(); i<cblock.Xend(); ++i )
         {
-            if ( (std::abs(m_coeff_data[j][i])<<2) >= u_threshold )
+            if ( (int(std::abs(m_coeff_data[j][i]))<<2) >= u_threshold )
                 can_skip = false;
         }   
     }
@@ -349,13 +349,13 @@
 
 CoeffType QuantChooser::BlockAbsMax( const Subband& node )
 {
-    int val( 0 );
+    CoeffType val( 0 );
 
     for (int j=node.Yp() ; j<node.Yp()+node.Yl(); ++j)
     {
         for (int i=node.Xp() ; i<node.Xp()+node.Xl(); ++i)
         {    
-            val = std::max( val , std::abs(m_coeff_data[j][i]) );
+            val = std::max( val , CoeffType(std::abs(m_coeff_data[j][i])) );
         }// i
     }// j
 
diff -aur dirac-1.0.2/libdirac_encoder/seq_compress.cpp dirac-1.0.2-modif/libdirac_encoder/seq_compress.cpp
--- dirac-1.0.2/libdirac_encoder/seq_compress.cpp	2008-10-29 05:42:06.000000000 +0300
+++ dirac-1.0.2-modif/libdirac_encoder/seq_compress.cpp	2016-02-10 20:16:24.108885403 +0300
@@ -663,7 +663,6 @@
 
 int FrameSequenceCompressor::CodedToDisplay( const int cnum )
 {
-    int div;
 
     if (m_L1_sep>0)
     {
@@ -672,7 +671,6 @@
             return 0;
         else if ((cnum-1)% m_L1_sep==0)
         {//we have L1 or subsequent I pictures
-            div=(cnum-1)/m_L1_sep;
             return cnum+m_L1_sep-1;
         }
         else//we have L2 pictures
diff -aur dirac-1.0.2/libdirac_motionest/me_utils.cpp dirac-1.0.2-modif/libdirac_motionest/me_utils.cpp
--- dirac-1.0.2/libdirac_motionest/me_utils.cpp	2008-10-21 08:55:46.000000000 +0400
+++ dirac-1.0.2-modif/libdirac_motionest/me_utils.cpp	2016-02-10 20:04:40.068175649 +0300
@@ -684,10 +684,10 @@
         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
 
        // weights for doing linear interpolation, calculated from the remainder values
-        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
-                                           rmdr.x * (2 - rmdr.y),          //tr
-                                           (2 - rmdr.x) * rmdr.y,          //bl
-                                           rmdr.x * rmdr.y };              //br
+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
+                                           ValueType(rmdr.x * rmdr.y) };              //br
 
         const int refXlen( m_ref_data.LengthX() );
         const int refYlen( m_ref_data.LengthY() );
@@ -848,10 +848,10 @@
         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
 
        // weights for doing linear interpolation, calculated from the remainder values
-        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
-                                           rmdr.x * (2 - rmdr.y),          //tr
-                                           (2 - rmdr.x) * rmdr.y,          //bl
-                                           rmdr.x * rmdr.y };              //br
+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
+                                           ValueType(rmdr.x * rmdr.y) };              //br
 
         const int refXlen( m_ref_data.LengthX() );
         const int refYlen( m_ref_data.LengthY() );
@@ -908,10 +908,10 @@
     const int pic_next( m_pic_data.LengthX() - dparams.Xl() );// go down a row and back up
 
     //weights for doing linear interpolation, calculated from the remainder values
-    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
-                                       rmdr.x * (4 - rmdr.y),          //tr
-                                       (4 - rmdr.x) * rmdr.y,          //bl
-                                       rmdr.x * rmdr.y };              //br
+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
+                                       ValueType(rmdr.x * (4 - rmdr.y)),          //tr
+                                       ValueType((4 - rmdr.x) * rmdr.y),          //bl
+                                       ValueType(rmdr.x * rmdr.y) };              //br
 
     bool bounds_check( false );
 
@@ -1039,10 +1039,10 @@
     const int pic_next( m_pic_data.LengthX() - dparams.Xl() );// go down a row and back up
 
     //weights for doing linear interpolation, calculated from the remainder values
-    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
-                                       rmdr.x * (4 - rmdr.y),          //tr
-                                       (4 - rmdr.x) * rmdr.y,          //bl
-                                       rmdr.x * rmdr.y };              //br
+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
+                                       ValueType(rmdr.x * (4 - rmdr.y)),          //tr
+                                       ValueType((4 - rmdr.x) * rmdr.y),          //bl
+                                       ValueType(rmdr.x * rmdr.y) };              //br
 
     bool bounds_check( false );
 
@@ -1403,10 +1403,10 @@
     }
     else
     {
-        const ValueType linear_wts[4] = {  (2 - rmdr1.x) * (2 - rmdr1.y),    //tl
-                                           rmdr1.x * (2 - rmdr1.y),          //tr
-                                           (2 - rmdr1.x) * rmdr1.y,          //bl
-                                           rmdr1.x * rmdr1.y };              //br
+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr1.x) * (2 - rmdr1.y)),    //tl
+                                           ValueType(rmdr1.x * (2 - rmdr1.y)),          //tr
+                                           ValueType((2 - rmdr1.x) * rmdr1.y),          //bl
+                                           ValueType(rmdr1.x * rmdr1.y) };              //br
 
         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
         for( int y=dparams.Yl(), ry=ref_start1.y, by=BChk(ry,m_ref_data1.LengthY()), by1=BChk(ry+1,m_ref_data1.LengthY()); 
@@ -1513,10 +1513,10 @@
     }
     else
     {
-        const ValueType linear_wts[4] = {  (2 - rmdr2.x) * (2 - rmdr2.y),    //tl
-                                           rmdr2.x * (2 - rmdr2.y),          //tr
-                                           (2 - rmdr2.x) * rmdr2.y,          //bl
-                                           rmdr2.x * rmdr2.y };              //br
+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr2.x) * (2 - rmdr2.y)),    //tl
+                                           ValueType(rmdr2.x * (2 - rmdr2.y)),          //tr
+                                           ValueType((2 - rmdr2.x) * rmdr2.y),          //bl
+                                           ValueType(rmdr2.x * rmdr2.y) };              //br
 
         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
         for( int y=dparams.Yl(), ry=ref_start2.y, by=BChk(ry,m_ref_data2.LengthY()),by1=BChk(ry+1,m_ref_data2.LengthY()); 
@@ -1564,14 +1564,14 @@
     const MVector rmdr2( mv2.x & 3 , mv2.y & 3 );
 
     //weights for doing linear interpolation, calculated from the remainder values
-    const ValueType linear_wts1[4] = {  (4 - rmdr1.x) * (4 - rmdr1.y),    //tl
-                                       rmdr1.x * (4 - rmdr1.y),          //tr
-                                       (4 - rmdr1.x) * rmdr1.y,          //bl
-                                       rmdr1.x * rmdr1.y };              //br
-    const ValueType linear_wts2[4] = {  (4 - rmdr2.x) * (4 - rmdr2.y),    //tl
-                                       rmdr2.x * (4 - rmdr2.y),          //tr
-                                       (4 - rmdr2.x) * rmdr2.y,          //bl
-                                       rmdr2.x * rmdr2.y };              //br
+    const ValueType linear_wts1[4] = {  ValueType((4 - rmdr1.x) * (4 - rmdr1.y)),    //tl
+                                        ValueType(rmdr1.x * (4 - rmdr1.y)),          //tr
+                                        ValueType((4 - rmdr1.x) * rmdr1.y),          //bl
+                                        ValueType(rmdr1.x * rmdr1.y) };              //br
+    const ValueType linear_wts2[4] = {  ValueType((4 - rmdr2.x) * (4 - rmdr2.y)),    //tl
+                                        ValueType(rmdr2.x * (4 - rmdr2.y)),          //tr
+                                        ValueType((4 - rmdr2.x) * rmdr2.y),          //bl
+                                        ValueType(rmdr2.x * rmdr2.y) };              //br
 
     //Where to start in the upconverted images
     const ImageCoords ref_start1( ( dparams.Xp()<<1 ) + roundvec1.x ,( dparams.Yp()<<1 ) + roundvec1.y );
diff -aur dirac-1.0.2/util/conversion/common/bitmap.cpp dirac-1.0.2-modif/util/conversion/common/bitmap.cpp
--- dirac-1.0.2/util/conversion/common/bitmap.cpp	2004-06-30 20:44:52.000000000 +0400
+++ dirac-1.0.2-modif/util/conversion/common/bitmap.cpp	2016-02-10 20:19:58.355494888 +0300
@@ -142,14 +142,9 @@
         char signature[2];
         int fileSize;
         int dataOffset;
-        int size;
         int planes;
         int bitCount;
         int compression;
-        int imageSize;
-        int xPixelsPerM, yPixelsPerM;
-        int coloursUsed;
-        int coloursImportant;
         //Define buffer to read bytes into.
         const int bufferSize = 54;
         char buffer[bufferSize];
@@ -175,7 +170,7 @@
         //Reposition input buffer to skip over extra header data if necessary
         //Should check success of operation (see The C++ Stand Lib, Josuttis, p665)
         if (dataOffset>54) inbuf.pubseekoff(dataOffset-54, std::ios_base::cur, std::ios_base::in);
-        size = read4bytes(buffer+14);
+        (void)read4bytes(buffer+14); // size
         w = read4bytes(buffer+18);
         h = read4bytes(buffer+22);
         if ( fileSize != (dataOffset + height()*lineBufferSize()) ) input.setstate(std::ios::failbit);
@@ -185,11 +180,11 @@
         if ( bitCount != 24 ) input.setstate(std::ios::failbit);
         compression = read4bytes(buffer+30);
         if ( compression != 0 ) input.setstate(std::ios::failbit);
-        imageSize = read4bytes(buffer+34);
-        xPixelsPerM = read4bytes(buffer+38);
-        yPixelsPerM = read4bytes(buffer+42);
-        coloursUsed = read4bytes(buffer+46);
-        coloursImportant = read4bytes(buffer+50);
+        (void)read4bytes(buffer+34); // imageSize
+        (void)read4bytes(buffer+38); // xPixelsPerM
+        (void)read4bytes(buffer+42); // yPixelsPerM
+        (void)read4bytes(buffer+46); // coloursUsed
+        (void)read4bytes(buffer+50); // coloursImportant
         return input; }
 
 }  // end namespace dirac_vu