Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: vicodec: rename and use proper fwht prefix for codec

The codec source is generic and not vicodec specific. It can be used
by other drivers or userspace as well. So rename the source and header
to something more generic (codec-fwht.c/h) and prefix the defines, types
and functions with fwht_.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>

authored by

Hans Verkuil and committed by
Mauro Carvalho Chehab
21abebf0 abe9d19a

+118 -114
+1 -1
Documentation/media/uapi/v4l/pixfmt-compressed.rst
··· 101 101 - 'FWHT' 102 102 - Video elementary stream using a codec based on the Fast Walsh Hadamard 103 103 Transform. This codec is implemented by the vicodec ('Virtual Codec') 104 - driver. See the vicodec-codec.h header for more details. 104 + driver. See the codec-fwht.h header for more details.
+1 -1
drivers/media/platform/vicodec/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - vicodec-objs := vicodec-core.o vicodec-codec.o 2 + vicodec-objs := vicodec-core.o codec-fwht.o 3 3 4 4 obj-$(CONFIG_VIDEO_VICODEC) += vicodec.o
+38 -24
drivers/media/platform/vicodec/vicodec-codec.c drivers/media/platform/vicodec/codec-fwht.c
··· 10 10 */ 11 11 12 12 #include <linux/string.h> 13 - #include "vicodec-codec.h" 13 + #include "codec-fwht.h" 14 + 15 + /* 16 + * Note: bit 0 of the header must always be 0. Otherwise it cannot 17 + * be guaranteed that the magic 8 byte sequence (see below) can 18 + * never occur in the rlc output. 19 + */ 20 + #define PFRAME_BIT BIT(15) 21 + #define DUPS_MASK 0x1ffe 22 + 23 + #define PBLOCK 0 24 + #define IBLOCK 1 14 25 15 26 #define ALL_ZEROS 15 16 27 ··· 653 642 } 654 643 655 644 static u32 encode_plane(u8 *input, u8 *refp, __be16 **rlco, __be16 *rlco_max, 656 - struct cframe *cf, u32 height, u32 width, 645 + struct fwht_cframe *cf, u32 height, u32 width, 657 646 unsigned int input_step, 658 647 bool is_intra, bool next_is_intra) 659 648 { ··· 680 669 cf->i_frame_qp); 681 670 } else { 682 671 /* inter code */ 683 - encoding |= FRAME_PCODED; 672 + encoding |= FWHT_FRAME_PCODED; 684 673 fwht16(deltablock, cf->coeffs, 8, 0); 685 674 quantize_inter(cf->coeffs, cf->de_coeffs, 686 675 cf->p_frame_qp); ··· 711 700 *rlco += size; 712 701 } 713 702 if (*rlco >= rlco_max) { 714 - encoding |= FRAME_UNENCODED; 703 + encoding |= FWHT_FRAME_UNENCODED; 715 704 goto exit_loop; 716 705 } 717 706 last_size = size; ··· 720 709 } 721 710 722 711 exit_loop: 723 - if (encoding & FRAME_UNENCODED) { 712 + if (encoding & FWHT_FRAME_UNENCODED) { 724 713 u8 *out = (u8 *)rlco_start; 725 714 726 715 input = input_start; ··· 733 722 for (i = 0; i < height * width; i++, input += input_step) 734 723 *out++ = (*input == 0xff) ? 0xfe : *input; 735 724 *rlco = (__be16 *)out; 736 - encoding &= ~FRAME_PCODED; 725 + encoding &= ~FWHT_FRAME_PCODED; 737 726 } 738 727 return encoding; 739 728 } 740 729 741 - u32 encode_frame(struct raw_frame *frm, struct raw_frame *ref_frm, 742 - struct cframe *cf, bool is_intra, bool next_is_intra) 730 + u32 fwht_encode_frame(struct fwht_raw_frame *frm, 731 + struct fwht_raw_frame *ref_frm, 732 + struct fwht_cframe *cf, 733 + bool is_intra, bool next_is_intra) 743 734 { 744 735 unsigned int size = frm->height * frm->width; 745 736 __be16 *rlco = cf->rlc_data; ··· 755 742 encoding = encode_plane(frm->luma, ref_frm->luma, &rlco, rlco_max, cf, 756 743 frm->height, frm->width, 757 744 frm->luma_step, is_intra, next_is_intra); 758 - if (encoding & FRAME_UNENCODED) 759 - encoding |= LUMA_UNENCODED; 760 - encoding &= ~FRAME_UNENCODED; 745 + if (encoding & FWHT_FRAME_UNENCODED) 746 + encoding |= FWHT_LUMA_UNENCODED; 747 + encoding &= ~FWHT_FRAME_UNENCODED; 761 748 rlco_max = rlco + chroma_size / 2 - 256; 762 749 encoding |= encode_plane(frm->cb, ref_frm->cb, &rlco, rlco_max, cf, 763 750 chroma_h, chroma_w, 764 751 frm->chroma_step, is_intra, next_is_intra); 765 - if (encoding & FRAME_UNENCODED) 766 - encoding |= CB_UNENCODED; 767 - encoding &= ~FRAME_UNENCODED; 752 + if (encoding & FWHT_FRAME_UNENCODED) 753 + encoding |= FWHT_CB_UNENCODED; 754 + encoding &= ~FWHT_FRAME_UNENCODED; 768 755 rlco_max = rlco + chroma_size / 2 - 256; 769 756 encoding |= encode_plane(frm->cr, ref_frm->cr, &rlco, rlco_max, cf, 770 757 chroma_h, chroma_w, 771 758 frm->chroma_step, is_intra, next_is_intra); 772 - if (encoding & FRAME_UNENCODED) 773 - encoding |= CR_UNENCODED; 774 - encoding &= ~FRAME_UNENCODED; 759 + if (encoding & FWHT_FRAME_UNENCODED) 760 + encoding |= FWHT_CR_UNENCODED; 761 + encoding &= ~FWHT_FRAME_UNENCODED; 775 762 cf->size = (rlco - cf->rlc_data) * sizeof(*rlco); 776 763 return encoding; 777 764 } 778 765 779 - static void decode_plane(struct cframe *cf, const __be16 **rlco, u8 *ref, 766 + static void decode_plane(struct fwht_cframe *cf, const __be16 **rlco, u8 *ref, 780 767 u32 height, u32 width, bool uncompressed) 781 768 { 782 769 unsigned int copies = 0; ··· 829 816 } 830 817 } 831 818 832 - void decode_frame(struct cframe *cf, struct raw_frame *ref, u32 hdr_flags) 819 + void fwht_decode_frame(struct fwht_cframe *cf, struct fwht_raw_frame *ref, 820 + u32 hdr_flags) 833 821 { 834 822 const __be16 *rlco = cf->rlc_data; 835 823 u32 h = cf->height / 2; 836 824 u32 w = cf->width / 2; 837 825 838 - if (hdr_flags & VICODEC_FL_CHROMA_FULL_HEIGHT) 826 + if (hdr_flags & FWHT_FL_CHROMA_FULL_HEIGHT) 839 827 h *= 2; 840 - if (hdr_flags & VICODEC_FL_CHROMA_FULL_WIDTH) 828 + if (hdr_flags & FWHT_FL_CHROMA_FULL_WIDTH) 841 829 w *= 2; 842 830 decode_plane(cf, &rlco, ref->luma, cf->height, cf->width, 843 - hdr_flags & VICODEC_FL_LUMA_IS_UNCOMPRESSED); 831 + hdr_flags & FWHT_FL_LUMA_IS_UNCOMPRESSED); 844 832 decode_plane(cf, &rlco, ref->cb, h, w, 845 - hdr_flags & VICODEC_FL_CB_IS_UNCOMPRESSED); 833 + hdr_flags & FWHT_FL_CB_IS_UNCOMPRESSED); 846 834 decode_plane(cf, &rlco, ref->cr, h, w, 847 - hdr_flags & VICODEC_FL_CR_IS_UNCOMPRESSED); 835 + hdr_flags & FWHT_FL_CR_IS_UNCOMPRESSED); 848 836 }
+33 -44
drivers/media/platform/vicodec/vicodec-codec.h drivers/media/platform/vicodec/codec-fwht.h
··· 4 4 * Copyright 2018 Cisco Systems, Inc. and/or its affiliates. All rights reserved. 5 5 */ 6 6 7 - #ifndef VICODEC_RLC_H 8 - #define VICODEC_RLC_H 7 + #ifndef CODEC_FWHT_H 8 + #define CODEC_FWHT_H 9 9 10 10 #include <linux/types.h> 11 11 #include <linux/bitops.h> 12 12 #include <asm/byteorder.h> 13 13 14 14 /* 15 - * The compressed format consists of a cframe_hdr struct followed by the 15 + * The compressed format consists of a fwht_cframe_hdr struct followed by the 16 16 * compressed frame data. The header contains the size of that data. 17 17 * Each Y, Cb and Cr plane is compressed separately. If the compressed 18 18 * size of each plane becomes larger than the uncompressed size, then ··· 35 35 * 36 36 * All 16 and 32 bit values are stored in big-endian (network) order. 37 37 * 38 - * Each cframe_hdr starts with an 8 byte magic header that is 38 + * Each fwht_cframe_hdr starts with an 8 byte magic header that is 39 39 * guaranteed not to occur in the compressed frame data. This header 40 40 * can be used to sync to the next frame. 41 41 * ··· 47 47 */ 48 48 49 49 /* 50 - * Note: bit 0 of the header must always be 0. Otherwise it cannot 51 - * be guaranteed that the magic 8 byte sequence (see below) can 52 - * never occur in the rlc output. 53 - */ 54 - #define PFRAME_BIT (1 << 15) 55 - #define DUPS_MASK 0x1ffe 56 - 57 - /* 58 50 * This is a sequence of 8 bytes with the low 4 bits set to 0xf. 59 51 * 60 52 * This sequence cannot occur in the encoded data 53 + * 54 + * Note that these two magic values are symmetrical so endian issues here. 61 55 */ 62 - #define VICODEC_MAGIC1 0x4f4f4f4f 63 - #define VICODEC_MAGIC2 0xffffffff 56 + #define FWHT_MAGIC1 0x4f4f4f4f 57 + #define FWHT_MAGIC2 0xffffffff 64 58 65 - #define VICODEC_VERSION 1 66 - 67 - #define VICODEC_MAX_WIDTH 3840 68 - #define VICODEC_MAX_HEIGHT 2160 69 - #define VICODEC_MIN_WIDTH 640 70 - #define VICODEC_MIN_HEIGHT 480 71 - 72 - #define PBLOCK 0 73 - #define IBLOCK 1 59 + #define FWHT_VERSION 1 74 60 75 61 /* Set if this is an interlaced format */ 76 - #define VICODEC_FL_IS_INTERLACED BIT(0) 62 + #define FWHT_FL_IS_INTERLACED BIT(0) 77 63 /* Set if this is a bottom-first (NTSC) interlaced format */ 78 - #define VICODEC_FL_IS_BOTTOM_FIRST BIT(1) 64 + #define FWHT_FL_IS_BOTTOM_FIRST BIT(1) 79 65 /* Set if each 'frame' contains just one field */ 80 - #define VICODEC_FL_IS_ALTERNATE BIT(2) 66 + #define FWHT_FL_IS_ALTERNATE BIT(2) 81 67 /* 82 - * If VICODEC_FL_IS_ALTERNATE was set, then this is set if this 68 + * If FWHT_FL_IS_ALTERNATE was set, then this is set if this 83 69 * 'frame' is the bottom field, else it is the top field. 84 70 */ 85 - #define VICODEC_FL_IS_BOTTOM_FIELD BIT(3) 71 + #define FWHT_FL_IS_BOTTOM_FIELD BIT(3) 86 72 /* Set if this frame is uncompressed */ 87 - #define VICODEC_FL_LUMA_IS_UNCOMPRESSED BIT(4) 88 - #define VICODEC_FL_CB_IS_UNCOMPRESSED BIT(5) 89 - #define VICODEC_FL_CR_IS_UNCOMPRESSED BIT(6) 90 - #define VICODEC_FL_CHROMA_FULL_HEIGHT BIT(7) 91 - #define VICODEC_FL_CHROMA_FULL_WIDTH BIT(8) 73 + #define FWHT_FL_LUMA_IS_UNCOMPRESSED BIT(4) 74 + #define FWHT_FL_CB_IS_UNCOMPRESSED BIT(5) 75 + #define FWHT_FL_CR_IS_UNCOMPRESSED BIT(6) 76 + #define FWHT_FL_CHROMA_FULL_HEIGHT BIT(7) 77 + #define FWHT_FL_CHROMA_FULL_WIDTH BIT(8) 92 78 93 - struct cframe_hdr { 79 + struct fwht_cframe_hdr { 94 80 u32 magic1; 95 81 u32 magic2; 96 82 __be32 version; ··· 89 103 __be32 size; 90 104 }; 91 105 92 - struct cframe { 106 + struct fwht_cframe { 93 107 unsigned int width, height; 94 108 u16 i_frame_qp; 95 109 u16 p_frame_qp; ··· 100 114 u32 size; 101 115 }; 102 116 103 - struct raw_frame { 117 + struct fwht_raw_frame { 104 118 unsigned int width, height; 105 119 unsigned int width_div; 106 120 unsigned int height_div; ··· 109 123 u8 *luma, *cb, *cr; 110 124 }; 111 125 112 - #define FRAME_PCODED BIT(0) 113 - #define FRAME_UNENCODED BIT(1) 114 - #define LUMA_UNENCODED BIT(2) 115 - #define CB_UNENCODED BIT(3) 116 - #define CR_UNENCODED BIT(4) 126 + #define FWHT_FRAME_PCODED BIT(0) 127 + #define FWHT_FRAME_UNENCODED BIT(1) 128 + #define FWHT_LUMA_UNENCODED BIT(2) 129 + #define FWHT_CB_UNENCODED BIT(3) 130 + #define FWHT_CR_UNENCODED BIT(4) 117 131 118 - u32 encode_frame(struct raw_frame *frm, struct raw_frame *ref_frm, 119 - struct cframe *cf, bool is_intra, bool next_is_intra); 120 - void decode_frame(struct cframe *cf, struct raw_frame *ref, u32 hdr_flags); 132 + u32 fwht_encode_frame(struct fwht_raw_frame *frm, 133 + struct fwht_raw_frame *ref_frm, 134 + struct fwht_cframe *cf, 135 + bool is_intra, bool next_is_intra); 136 + void fwht_decode_frame(struct fwht_cframe *cf, struct fwht_raw_frame *ref, 137 + u32 hdr_flags); 121 138 122 139 #endif
+45 -44
drivers/media/platform/vicodec/vicodec-core.c
··· 23 23 #include <media/v4l2-event.h> 24 24 #include <media/videobuf2-vmalloc.h> 25 25 26 - #include "vicodec-codec.h" 26 + #include "codec-fwht.h" 27 27 28 28 MODULE_DESCRIPTION("Virtual codec device"); 29 29 MODULE_AUTHOR("Hans Verkuil <hans.verkuil@cisco.com>"); ··· 152 152 153 153 /* Source and destination queue data */ 154 154 struct vicodec_q_data q_data[2]; 155 - struct raw_frame ref_frame; 155 + struct fwht_raw_frame ref_frame; 156 156 u8 *compressed_frame; 157 157 u32 cur_buf_offset; 158 158 u32 comp_max_size; ··· 191 191 { 192 192 unsigned int size = q_data->width * q_data->height; 193 193 const struct pixfmt_info *info = q_data->info; 194 - struct cframe_hdr *p_hdr; 195 - struct cframe cf; 196 - struct raw_frame rf; 194 + struct fwht_cframe_hdr *p_hdr; 195 + struct fwht_cframe cf; 196 + struct fwht_raw_frame rf; 197 197 u32 encoding; 198 198 199 199 rf.width = q_data->width; ··· 279 279 cf.p_frame_qp = ctx->p_frame_qp; 280 280 cf.rlc_data = (__be16 *)(p_out + sizeof(*p_hdr)); 281 281 282 - encoding = encode_frame(&rf, &ctx->ref_frame, &cf, !ctx->gop_cnt, 283 - ctx->gop_cnt == ctx->gop_size - 1); 284 - if (!(encoding & FRAME_PCODED)) 282 + encoding = fwht_encode_frame(&rf, &ctx->ref_frame, &cf, !ctx->gop_cnt, 283 + ctx->gop_cnt == ctx->gop_size - 1); 284 + if (!(encoding & FWHT_FRAME_PCODED)) 285 285 ctx->gop_cnt = 0; 286 286 if (++ctx->gop_cnt >= ctx->gop_size) 287 287 ctx->gop_cnt = 0; 288 288 289 - p_hdr = (struct cframe_hdr *)p_out; 290 - p_hdr->magic1 = VICODEC_MAGIC1; 291 - p_hdr->magic2 = VICODEC_MAGIC2; 292 - p_hdr->version = htonl(VICODEC_VERSION); 289 + p_hdr = (struct fwht_cframe_hdr *)p_out; 290 + p_hdr->magic1 = FWHT_MAGIC1; 291 + p_hdr->magic2 = FWHT_MAGIC2; 292 + p_hdr->version = htonl(FWHT_VERSION); 293 293 p_hdr->width = htonl(cf.width); 294 294 p_hdr->height = htonl(cf.height); 295 - if (encoding & LUMA_UNENCODED) 296 - flags |= VICODEC_FL_LUMA_IS_UNCOMPRESSED; 297 - if (encoding & CB_UNENCODED) 298 - flags |= VICODEC_FL_CB_IS_UNCOMPRESSED; 299 - if (encoding & CR_UNENCODED) 300 - flags |= VICODEC_FL_CR_IS_UNCOMPRESSED; 295 + if (encoding & FWHT_LUMA_UNENCODED) 296 + flags |= FWHT_FL_LUMA_IS_UNCOMPRESSED; 297 + if (encoding & FWHT_CB_UNENCODED) 298 + flags |= FWHT_FL_CB_IS_UNCOMPRESSED; 299 + if (encoding & FWHT_CR_UNENCODED) 300 + flags |= FWHT_FL_CR_IS_UNCOMPRESSED; 301 301 if (rf.height_div == 1) 302 - flags |= VICODEC_FL_CHROMA_FULL_HEIGHT; 302 + flags |= FWHT_FL_CHROMA_FULL_HEIGHT; 303 303 if (rf.width_div == 1) 304 - flags |= VICODEC_FL_CHROMA_FULL_WIDTH; 304 + flags |= FWHT_FL_CHROMA_FULL_WIDTH; 305 305 p_hdr->flags = htonl(flags); 306 306 p_hdr->colorspace = htonl(ctx->colorspace); 307 307 p_hdr->xfer_func = htonl(ctx->xfer_func); ··· 320 320 unsigned int chroma_size = size; 321 321 unsigned int i; 322 322 u32 flags; 323 - struct cframe_hdr *p_hdr; 324 - struct cframe cf; 323 + struct fwht_cframe_hdr *p_hdr; 324 + struct fwht_cframe cf; 325 325 u8 *p; 326 326 327 - p_hdr = (struct cframe_hdr *)p_in; 327 + p_hdr = (struct fwht_cframe_hdr *)p_in; 328 328 cf.width = ntohl(p_hdr->width); 329 329 cf.height = ntohl(p_hdr->height); 330 330 flags = ntohl(p_hdr->flags); ··· 334 334 ctx->quantization = ntohl(p_hdr->quantization); 335 335 cf.rlc_data = (__be16 *)(p_in + sizeof(*p_hdr)); 336 336 337 - if (p_hdr->magic1 != VICODEC_MAGIC1 || 338 - p_hdr->magic2 != VICODEC_MAGIC2 || 339 - ntohl(p_hdr->version) != VICODEC_VERSION || 340 - cf.width < VICODEC_MIN_WIDTH || 341 - cf.width > VICODEC_MAX_WIDTH || 342 - cf.height < VICODEC_MIN_HEIGHT || 343 - cf.height > VICODEC_MAX_HEIGHT || 337 + if (p_hdr->magic1 != FWHT_MAGIC1 || 338 + p_hdr->magic2 != FWHT_MAGIC2 || 339 + ntohl(p_hdr->version) != FWHT_VERSION || 340 + cf.width < MIN_WIDTH || 341 + cf.width > MAX_WIDTH || 342 + cf.height < MIN_HEIGHT || 343 + cf.height > MAX_HEIGHT || 344 344 (cf.width & 7) || (cf.height & 7)) 345 345 return -EINVAL; 346 346 ··· 348 348 if (cf.width != q_data->width || cf.height != q_data->height) 349 349 return -EINVAL; 350 350 351 - if (!(flags & VICODEC_FL_CHROMA_FULL_WIDTH)) 351 + if (!(flags & FWHT_FL_CHROMA_FULL_WIDTH)) 352 352 chroma_size /= 2; 353 - if (!(flags & VICODEC_FL_CHROMA_FULL_HEIGHT)) 353 + if (!(flags & FWHT_FL_CHROMA_FULL_HEIGHT)) 354 354 chroma_size /= 2; 355 355 356 - decode_frame(&cf, &ctx->ref_frame, flags); 356 + fwht_decode_frame(&cf, &ctx->ref_frame, flags); 357 357 358 358 switch (q_data->info->id) { 359 359 case V4L2_PIX_FMT_YUV420: ··· 484 484 } 485 485 486 486 if (ctx->is_enc) { 487 - struct cframe_hdr *p_hdr = (struct cframe_hdr *)p_out; 487 + struct fwht_cframe_hdr *p_hdr = (struct fwht_cframe_hdr *)p_out; 488 488 489 489 encode(ctx, q_out, p_in, p_out, 0); 490 490 vb2_set_plane_payload(&out_vb->vb2_buf, 0, ··· 635 635 } 636 636 ctx->comp_size = sizeof(magic); 637 637 } 638 - if (ctx->comp_size < sizeof(struct cframe_hdr)) { 639 - struct cframe_hdr *p_hdr = (struct cframe_hdr *)ctx->compressed_frame; 640 - u32 copy = sizeof(struct cframe_hdr) - ctx->comp_size; 638 + if (ctx->comp_size < sizeof(struct fwht_cframe_hdr)) { 639 + struct fwht_cframe_hdr *p_hdr = 640 + (struct fwht_cframe_hdr *)ctx->compressed_frame; 641 + u32 copy = sizeof(struct fwht_cframe_hdr) - ctx->comp_size; 641 642 642 643 if (copy > p_out + sz - p) 643 644 copy = p_out + sz - p; ··· 646 645 p, copy); 647 646 p += copy; 648 647 ctx->comp_size += copy; 649 - if (ctx->comp_size < sizeof(struct cframe_hdr)) { 648 + if (ctx->comp_size < sizeof(struct fwht_cframe_hdr)) { 650 649 job_remove_out_buf(ctx, state); 651 650 goto restart; 652 651 } ··· 671 670 ctx->cur_buf_offset = p - p_out; 672 671 ctx->comp_has_frame = true; 673 672 ctx->comp_has_next_frame = false; 674 - if (sz - ctx->cur_buf_offset >= sizeof(struct cframe_hdr)) { 675 - struct cframe_hdr *p_hdr = (struct cframe_hdr *)p; 673 + if (sz - ctx->cur_buf_offset >= sizeof(struct fwht_cframe_hdr)) { 674 + struct fwht_cframe_hdr *p_hdr = (struct fwht_cframe_hdr *)p; 676 675 u32 frame_size = ntohl(p_hdr->size); 677 676 u32 remaining = sz - ctx->cur_buf_offset - sizeof(*p_hdr); 678 677 ··· 846 845 pix->sizeimage = pix->width * pix->height * 847 846 info->sizeimage_mult / info->sizeimage_div; 848 847 if (pix->pixelformat == V4L2_PIX_FMT_FWHT) 849 - pix->sizeimage += sizeof(struct cframe_hdr); 848 + pix->sizeimage += sizeof(struct fwht_cframe_hdr); 850 849 break; 851 850 case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: 852 851 case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: ··· 864 863 plane->sizeimage = pix_mp->width * pix_mp->height * 865 864 info->sizeimage_mult / info->sizeimage_div; 866 865 if (pix_mp->pixelformat == V4L2_PIX_FMT_FWHT) 867 - plane->sizeimage += sizeof(struct cframe_hdr); 866 + plane->sizeimage += sizeof(struct fwht_cframe_hdr); 868 867 memset(pix_mp->reserved, 0, sizeof(pix_mp->reserved)); 869 868 memset(plane->reserved, 0, sizeof(plane->reserved)); 870 869 break; ··· 1309 1308 ctx->ref_frame.width = ctx->ref_frame.height = 0; 1310 1309 ctx->ref_frame.luma = kvmalloc(size + 2 * size / chroma_div, GFP_KERNEL); 1311 1310 ctx->comp_max_size = size + 2 * size / chroma_div + 1312 - sizeof(struct cframe_hdr); 1311 + sizeof(struct fwht_cframe_hdr); 1313 1312 ctx->compressed_frame = kvmalloc(ctx->comp_max_size, GFP_KERNEL); 1314 1313 if (!ctx->ref_frame.luma || !ctx->compressed_frame) { 1315 1314 kvfree(ctx->ref_frame.luma); ··· 1494 1493 ctx->q_data[V4L2_M2M_DST].sizeimage = size; 1495 1494 ctx->colorspace = V4L2_COLORSPACE_REC709; 1496 1495 1497 - size += sizeof(struct cframe_hdr); 1496 + size += sizeof(struct fwht_cframe_hdr); 1498 1497 if (ctx->is_enc) { 1499 1498 ctx->q_data[V4L2_M2M_DST].sizeimage = size; 1500 1499 ctx->fh.m2m_ctx = v4l2_m2m_ctx_init(dev->enc_dev, ctx,