From 322821a1381f81c4dd480d065bec13803c7e69dc Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 8 Aug 2020 01:43:12 +0300 Subject: crc: Add a utility to compute the CRC of a frame The discom-crc utility computes the CRC of a frame using the same algorithm as the DISCOM hardware block. This is useful to precompute CRC values and then compare them with the hardware-generated values. The utility computes the CRC on data stored in a file passed as a command line argument. It supports two optional arguments, --crop and --size, to specify the crop rectangle and the image size. The size only needs to be specified if a crop rectangle is set, it is deduced from the file size otherwise. Signed-off-by: Laurent Pinchart --- crc/Makefile | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 crc/Makefile (limited to 'crc/Makefile') diff --git a/crc/Makefile b/crc/Makefile new file mode 100644 index 0000000..0922163 --- /dev/null +++ b/crc/Makefile @@ -0,0 +1,32 @@ +# SPDX-License-Identifier: CC0-1.0 + +CROSS_COMPILE ?= + +CC := $(CROSS_COMPILE)gcc +CFLAGS ?= -O2 -W -Wall -Wno-unused-parameter -Iinclude +LDFLAGS ?= +LIBS := + +OUTPUT := discom-crc +OBJECTS := main.o + +%.o : %.c + $(CC) $(CFLAGS) -c -o $@ $< + +all: $(OUTPUT) + +$(OUTPUT): $(OBJECTS) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + +crc.c : gen-crc.py + ./$< $@ + +main.o : crc.c + +clean: + -rm -f *.o + -rm -f crc.c + -rm -f $(OUTPUT) + +install: + cp $(OUTPUT) $(INSTALL_DIR)/ -- cgit v1.2.3