[CinCV TNG] [PATCH] Use functions of BC_CModels for colorspace operations in cinelerra

Johannes Sixt j6t at kdbg.org
Tue Aug 8 23:17:56 CEST 2017


Am 08.08.2017 um 20:16 schrieb Einar R√ľnkaru:
> Subject: [PATCH] Use functions of BC_CModels for colorspace operations in
>   cinelerra
> 
> Where possible cmodel_transfer is replaced with VFrame::transfer_from
> ---
>   cinelerra/awindowgui.C       |  4 ++--
>   cinelerra/device1394output.C |  4 ++--
>   cinelerra/edl.C              |  2 +-
>   cinelerra/edlsession.C       | 14 ++++++-------
>   cinelerra/file.C             | 23 ++-------------------
>   cinelerra/filebase.C         |  1 -
>   cinelerra/filebase.h         |  1 -
>   cinelerra/fileexr.C          | 27 ++++---------------------
>   cinelerra/filelist.C         | 22 +-------------------
>   cinelerra/filemov.C          |  4 ++--
>   cinelerra/filempeg.C         | 48 +++-----------------------------------------
>   cinelerra/filepng.C          | 24 +---------------------
>   cinelerra/filetga.C          | 46 ++----------------------------------------
>   cinelerra/filethread.C       | 23 +--------------------
>   cinelerra/filetiff.C         | 23 ++-------------------
>   cinelerra/fileyuv.C          |  5 +++--
>   cinelerra/iec61883output.C   |  4 ++--
>   cinelerra/mwindow.C          | 22 +++++++-------------
>   cinelerra/playback3d.C       |  4 ++--
>   cinelerra/resourcepixmap.C   |  2 +-
>   cinelerra/resourcethread.C   | 24 ++--------------------
>   cinelerra/vdevicev4l.C       | 24 ++--------------------
>   cinelerra/vdevicex11.C       |  6 +++---
>   cinelerra/vmodule.C          |  3 +--
>   24 files changed, 53 insertions(+), 307 deletions(-)

Nice diffstat.

> @@ -1061,27 +1062,7 @@ int File::read_frame(VFrame *frame, int is_thread)
>   
>   			temp_frame->copy_stacks(frame);
>   			file->read_frame(temp_frame);
> -			cmodel_transfer(frame->get_rows(),
> -				temp_frame->get_rows(),
> -				frame->get_y(),
> -				frame->get_u(),
> -				frame->get_v(),
> -				temp_frame->get_y(),
> -				temp_frame->get_u(),
> -				temp_frame->get_v(),
> -				0,
> -				0,
> -				temp_frame->get_w(),
> -				temp_frame->get_h(),
> -				0,
> -				0,
> -				frame->get_w(),
> -				frame->get_h(),
> -				temp_frame->get_color_model(),
> -				frame->get_color_model(),
> -				0,
> -				temp_frame->get_w(),
> -				frame->get_w());
> +			frame->transfer_from(temp_frame);

The last two arguments in the old code are get_w(), the frame width. But 
in the new code it is get_bytes_per_line() as part of transfer_from(). 
Why is this OK?

Same comment applies to some other spots.

-- Hannes


More information about the Cinelerra mailing list