Skip to content

Commit 4d0f290

Browse files
solomonbstonermormj
authored andcommitted
gr-video-sdl: Remove if (1)
Remove `if (1)`. Signed-off-by: Solomon Tan <[email protected]>
1 parent 5ff50fe commit 4d0f290

File tree

2 files changed

+18
-44
lines changed

2 files changed

+18
-44
lines changed

gr-video-sdl/lib/sink_s_impl.cc

+9-22
Original file line numberDiff line numberDiff line change
@@ -270,28 +270,15 @@ int sink_s_impl::work(int noutput_items,
270270
}
271271
break;
272272
case 2:
273-
if (1) { // if(pixel_interleaved_uv)
274-
// first channel=Y, second channel is alternating pixels U and V
275-
src_pixels_0 = (short*)input_items[0];
276-
src_pixels_1 = (short*)input_items[1];
277-
for (int i = 0; i < noutput_items; i += d_chunk_size) {
278-
copy_plane_to_surface(12, d_chunk_size / 2, src_pixels_1);
279-
noutput_items_produced +=
280-
copy_plane_to_surface(0, d_chunk_size, src_pixels_0);
281-
src_pixels_0 += d_chunk_size;
282-
src_pixels_1 += d_chunk_size;
283-
}
284-
} else {
285-
// first channel=Y, second channel is alternating lines U and V
286-
src_pixels_0 = (short*)input_items[0];
287-
src_pixels_1 = (short*)input_items[1];
288-
for (int i = 0; i < noutput_items; i += d_chunk_size) {
289-
copy_plane_to_surface(1222, d_chunk_size / 2, src_pixels_1);
290-
noutput_items_produced +=
291-
copy_plane_to_surface(0, d_chunk_size, src_pixels_0);
292-
src_pixels_0 += d_chunk_size;
293-
src_pixels_1 += d_chunk_size;
294-
}
273+
// first channel=Y, second channel is alternating pixels U and V
274+
src_pixels_0 = (short*)input_items[0];
275+
src_pixels_1 = (short*)input_items[1];
276+
for (int i = 0; i < noutput_items; i += d_chunk_size) {
277+
copy_plane_to_surface(12, d_chunk_size / 2, src_pixels_1);
278+
noutput_items_produced +=
279+
copy_plane_to_surface(0, d_chunk_size, src_pixels_0);
280+
src_pixels_0 += d_chunk_size;
281+
src_pixels_1 += d_chunk_size;
295282
}
296283
break;
297284
case 1: // grey (Y) input

gr-video-sdl/lib/sink_uc_impl.cc

+9-22
Original file line numberDiff line numberDiff line change
@@ -265,28 +265,15 @@ int sink_uc_impl::work(int noutput_items,
265265
}
266266
break;
267267
case 2:
268-
if (1) { // if(pixel_interleaved_uv)
269-
// first channel=Y, second channel is alternating pixels U and V
270-
src_pixels_0 = (unsigned char*)input_items[0];
271-
src_pixels_1 = (unsigned char*)input_items[1];
272-
for (int i = 0; i < noutput_items; i += d_chunk_size) {
273-
copy_plane_to_surface(12, d_chunk_size / 2, src_pixels_1);
274-
noutput_items_produced +=
275-
copy_plane_to_surface(0, d_chunk_size, src_pixels_0);
276-
src_pixels_0 += d_chunk_size;
277-
src_pixels_1 += d_chunk_size;
278-
}
279-
} else {
280-
// first channel=Y, second channel is alternating lines U and V
281-
src_pixels_0 = (unsigned char*)input_items[0];
282-
src_pixels_1 = (unsigned char*)input_items[1];
283-
for (int i = 0; i < noutput_items; i += d_chunk_size) {
284-
copy_plane_to_surface(1222, d_chunk_size / 2, src_pixels_1);
285-
noutput_items_produced +=
286-
copy_plane_to_surface(0, d_chunk_size, src_pixels_0);
287-
src_pixels_0 += d_chunk_size;
288-
src_pixels_1 += d_chunk_size;
289-
}
268+
// first channel=Y, second channel is alternating pixels U and V
269+
src_pixels_0 = (unsigned char*)input_items[0];
270+
src_pixels_1 = (unsigned char*)input_items[1];
271+
for (int i = 0; i < noutput_items; i += d_chunk_size) {
272+
copy_plane_to_surface(12, d_chunk_size / 2, src_pixels_1);
273+
noutput_items_produced +=
274+
copy_plane_to_surface(0, d_chunk_size, src_pixels_0);
275+
src_pixels_0 += d_chunk_size;
276+
src_pixels_1 += d_chunk_size;
290277
}
291278
break;
292279
case 1: // grey (Y) input

0 commit comments

Comments
 (0)