summaryrefslogtreecommitdiff
path: root/media-video/mjpegtools/files/mjpegtools-2.2.1-gcc15-template.patch
blob: 66d017233233a6e86186d1dbc5cfc72bab735c4a (plain)
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
https://bugs.gentoo.org/936562
https://sourceforge.net/p/mjpeg/patches/63/
--- a/y4mdenoise/Region2D.hh
+++ b/y4mdenoise/Region2D.hh
@@ -97,35 +97,11 @@
 		// Add the given horizontal extent to the region.  Note that
 		// a_tnXEnd is technically one past the end of the extent.
 
-	template <class REGION, class REGION_TEMP>
-	void UnionDebug (Status_t &a_reStatus, INDEX a_tnY,
-			INDEX a_tnXStart, INDEX a_tnXEnd, REGION_TEMP &a_rTemp);
-		// Add the given horizontal extent to the region.  Note that
-		// a_tnXEnd is technically one past the end of the extent.
-		// Exhaustively (i.e. slowly) verifies the results, using a
-		// much simpler algorithm.
-		// Requires the use of a temporary region, usually of the
-		// final subclass' type, in order to work.  (Since that can't
-		// be known at this level, a template parameter is included for
-		// it.)
-
 	template <class REGION>
 	void Union (Status_t &a_reStatus, const REGION &a_rOther);
 		// Make the current region represent the union between itself
 		// and the other given region.
 
-	template <class REGION, class REGION_O, class REGION_TEMP>
-	void UnionDebug (Status_t &a_reStatus,
-			REGION_O &a_rOther, REGION_TEMP &a_rTemp);
-		// Make the current region represent the union between itself
-		// and the other given region.
-		// Exhaustively (i.e. slowly) verifies the results, using a
-		// much simpler algorithm.
-		// Requires the use of a temporary region, usually of the
-		// final subclass' type, in order to work.  (Since that can't
-		// be known at this level, a template parameter is included for
-		// it.)
-
 	//void Merge (Status_t &a_reStatus, INDEX a_tnY, INDEX a_tnXStart,
 	//		INDEX a_tnXEnd);
 		// Merge this extent into the current region.
@@ -166,36 +142,11 @@
 		// Subtract the given horizontal extent from the region.  Note
 		// that a_tnXEnd is technically one past the end of the extent.
 
-	template <class REGION_TEMP>
-	void SubtractDebug (Status_t &a_reStatus, INDEX a_tnY,
-			INDEX a_tnXStart, INDEX a_tnXEnd, REGION_TEMP &a_rTemp);
-		// Subtract the given horizontal extent from the region.  Note
-		// that a_tnXEnd is technically one past the end of the extent.
-		// Exhaustively (i.e. slowly) verifies the results, using a
-		// much simpler algorithm.
-		// Requires the use of a temporary region, usually of the
-		// final subclass' type, in order to work.  (Since that can't
-		// be known at this level, a template parameter is included for
-		// it.)
-
 	template <class REGION>
 	void Subtract (Status_t &a_reStatus, const REGION &a_rOther);
 		// Subtract the other region from the current region, i.e.
 		// remove from the current region any extents that exist in the
 		// other region.
-	
-	template <class REGION, class REGION_O, class REGION_TEMP>
-	void SubtractDebug (Status_t &a_reStatus, REGION_O &a_rOther,
-			REGION_TEMP &a_rTemp);
-		// Subtract the other region from the current region, i.e.
-		// remove from the current region any extents that exist in the
-		// other region.
-		// Exhaustively (i.e. slowly) verifies the results, using a
-		// much simpler algorithm.
-		// Requires the use of a temporary region, usually of the
-		// final subclass' type, in order to work.  (Since that can't
-		// be known at this level, a template parameter is included for
-		// it.)
 
 	//typedef ... ConstIterator;
 	//ConstIterator Begin (void) const { return m_setExtents.Begin(); }
@@ -404,85 +355,6 @@
 
 
 
-// Add the given horizontal extent to the region.
-template <class INDEX, class SIZE>
-template <class REGION, class REGION_TEMP>
-void
-Region2D<INDEX,SIZE>::UnionDebug (Status_t &a_reStatus, INDEX a_tnY,
-	INDEX a_tnXStart, INDEX a_tnXEnd, REGION_TEMP &a_rTemp)
-{
-	typename REGION::ConstIterator itHere;
-	typename REGION_TEMP::ConstIterator itHereO;
-	INDEX tnX;
-		// Used to loop through points.
-
-	// Make sure they didn't start us off with an error.
-	assert (a_reStatus == g_kNoError);
-
-	// Calculate the union.
-	a_rTemp.Assign (a_reStatus, *this);
-	if (a_reStatus != g_kNoError)
-		return;
-	a_rTemp.Union (a_reStatus, a_tnY, a_tnXStart, a_tnXEnd);
-	if (a_reStatus != g_kNoError)
-		return;
-	
-	// Loop through every point in the result, make sure it's in
-	// one of the two input regions.
-	for (itHereO = a_rTemp.Begin(); itHereO != a_rTemp.End(); ++itHereO)
-	{
-		const Extent &rHere = *itHereO;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (!((rHere.m_tnY == a_tnY
-				&& (tnX >= a_tnXStart && tnX < a_tnXEnd))
-			|| this->DoesContainPoint (rHere.m_tnY, tnX)))
-				goto error;
-		}
-	}
-
-	// Loop through every point in the original region, make sure
-	// it's in the result.
-	for (itHere = this->Begin(); itHere != this->End(); ++itHere)
-	{
-		const Extent &rHere = *itHere;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX))
-				goto error;
-		}
-	}
-
-	// Loop through every point in the added extent, make sure it's in
-	// the result.
-	for (tnX = a_tnXStart; tnX < a_tnXEnd; ++tnX)
-	{
-		if (!a_rTemp.DoesContainPoint (a_tnY, tnX))
-			goto error;
-	}
-
-	// The operation succeeded.  Commit it.
-	Assign (a_reStatus, a_rTemp);
-	if (a_reStatus != g_kNoError)
-		return;
-
-	// All done.
-	return;
-
-error:
-	// Handle deviations.
-	fprintf (stderr, "Region2D::Union() failed\n");
-	fprintf (stderr, "Input region:\n");
-	PrintRegion (*this);
-	fprintf (stderr, "Input extent: [%d,%d-%d]\n",
-		int (a_tnY), int (a_tnXStart), int (a_tnXEnd));
-	fprintf (stderr, "Result:\n");
-	PrintRegion (a_rTemp);
-	assert (false);
-}
-
-
-
 // Make the current region represent the union between itself
 // and the other given region.
 template <class INDEX, class SIZE>
@@ -511,184 +383,6 @@
 	}
 }
 
-
-
-// Make the current region represent the union between itself
-// and the other given region.
-template <class INDEX, class SIZE>
-template <class REGION, class REGION_O, class REGION_TEMP>
-void
-Region2D<INDEX,SIZE>::UnionDebug (Status_t &a_reStatus,
-	REGION_O &a_rOther, REGION_TEMP &a_rTemp)
-{
-	typename REGION::ConstIterator itHere;
-	typename REGION_O::ConstIterator itHereO;
-	typename REGION_TEMP::ConstIterator itHereT;
-	INDEX tnX;
-		// Used to loop through points.
-
-	// Make sure they didn't start us off with an error.
-	assert (a_reStatus == g_kNoError);
-
-	// Calculate the union.
-	a_rTemp.Assign (a_reStatus, *this);
-	if (a_reStatus != g_kNoError)
-		return;
-	a_rTemp.Union (a_reStatus, a_rOther);
-	if (a_reStatus != g_kNoError)
-		return;
-	
-	// Loop through every point in the result, make sure it's in
-	// one of the two input regions.
-	for (itHereT = a_rTemp.Begin(); itHereT != a_rTemp.End(); ++itHereT)
-	{
-		const Extent &rHere = *itHereT;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (!a_rOther.DoesContainPoint (rHere.m_tnY, tnX)
-			&& !this->DoesContainPoint (rHere.m_tnY, tnX))
-				goto error;
-		}
-	}
-
-	// Loop through every point in the first input region, make sure
-	// it's in the result.
-	for (itHere = this->Begin(); itHere != this->End(); ++itHere)
-	{
-		const Extent &rHere = *itHere;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX))
-				goto error;
-		}
-	}
-
-	// Loop through every point in the second input region, make sure
-	// it's in the result.
-	for (itHereO = a_rOther.Begin();
-		 itHereO != a_rOther.End();
-		 ++itHereO)
-	{
-		const Extent &rHere = *itHereO;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX))
-				goto error;
-		}
-	}
-
-	// The operation succeeded.  Commit it.
-	Assign (a_reStatus, a_rTemp);
-	if (a_reStatus != g_kNoError)
-		return;
-
-	// All done.
-	return;
-
-error:
-	// Handle deviations.
-	fprintf (stderr, "Region2D::Union() failed\n");
-	fprintf (stderr, "First input region:\n");
-	PrintRegion (*this);
-	fprintf (stderr, "Second input region:\n");
-	PrintRegion (a_rOther);
-	fprintf (stderr, "Result:\n");
-	PrintRegion (a_rTemp);
-	assert (false);
-}
-
-
-
-// Subtract the other region from the current region, i.e.
-// remove from the current region any areas that exist in the
-// other region.
-template <class INDEX, class SIZE>
-template <class REGION, class REGION_O, class REGION_TEMP>
-void
-Region2D<INDEX,SIZE>::SubtractDebug (Status_t &a_reStatus,
-	REGION_O &a_rOther, REGION_TEMP &a_rTemp)
-{
-	typename REGION::ConstIterator itHere;
-	typename REGION_O::ConstIterator itHereO;
-	typename REGION_TEMP::ConstIterator itHereT;
-	INDEX tnX;
-		// Used to loop through points.
-
-	// Make sure they didn't start us off with an error.
-	assert (a_reStatus == g_kNoError);
-
-	// Calculate the difference.
-	a_rTemp.Assign (a_reStatus, *this);
-	if (a_reStatus != g_kNoError)
-		return;
-	a_rTemp.Subtract (a_reStatus, a_rOther);
-	if (a_reStatus != g_kNoError)
-		return;
-	
-	// Loop through every point in the result, make sure it's in
-	// the first input region but not the second.
-	for (itHereT = a_rTemp.Begin(); itHereT != a_rTemp.End(); ++itHereT)
-	{
-		const Extent &rHere = *itHereT;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (!(this->DoesContainPoint (rHere.m_tnY, tnX)
-			&& !a_rOther.DoesContainPoint (rHere.m_tnY, tnX)))
-				goto error;
-		}
-	}
-
-	// Loop through every point in the first input region, and if it's
-	// not in the second input region, make sure it's in the result.
-	for (itHere = this->Begin(); itHere != this->End(); ++itHere)
-	{
-		const Extent &rHere = *itHere;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (!a_rOther.DoesContainPoint (rHere.m_tnY, tnX))
-			{
-				if (!a_rTemp.DoesContainPoint (rHere.m_tnY, tnX))
-					goto error;
-			}
-		}
-	}
-
-	// Loop through every point in the second input region, make sure
-	// it's not in the result.
-	for (itHereO = a_rOther.Begin();
-		 itHereO != a_rOther.End();
-		 ++itHereO)
-	{
-		const Extent &rHere = *itHere;
-		for (tnX = rHere.m_tnXStart; tnX < rHere.m_tnXEnd; ++tnX)
-		{
-			if (a_rTemp.DoesContainPoint (rHere.m_tnY, tnX))
-				goto error;
-		}
-	}
-
-	// The operation succeeded.  Commit it.
-	Assign (a_reStatus, a_rTemp);
-	if (a_reStatus != g_kNoError)
-		return;
-
-	// All done.
-	return;
-
-error:
-	// Handle deviations.
-	fprintf (stderr, "Region2D::Subtract() failed\n");
-	fprintf (stderr, "First input region:\n");
-	PrintRegion (*this);
-	fprintf (stderr, "Second input region:\n");
-	PrintRegion (a_rOther);
-	fprintf (stderr, "Result:\n");
-	PrintRegion (a_rTemp);
-	assert (false);
-}
-
-
-
 // Flood-fill the current region.
 template <class INDEX, class SIZE>
 template <class CONTROL>