1 #include <VLIB/video_controller.h>
2 #include <VLIB/video_picture.h>
4 #include <VLIB/Platform/video_config.h>
5 #include <VLIB/Platform/video_utils.h>
9 static uint32_t num_references = 0;
11 #if (VIDEO_DCT_USE_INTRAM == 1)
12 // Put DMA buffer into INTRAM, this should avoid bus contention with CAMIF
13 static int16_t dct_buffer[2*DCT_BUFFER_SIZE] __attribute__((aligned(CACHE_DLINESIZE), section(".data.fast")));
16 C_RESULT video_utils_init( video_controller_t* controller )
18 if( num_references == 0 )
20 #if (VIDEO_DCT_USE_INTRAM == 1)
21 // Put in non cached INTRAM
22 controller->blockline_cache = (int16_t*) (((CYG_ADDRESS) &dct_buffer[0]) + CYGMEM_REGION_intram_SHADOW - CYGMEM_REGION_intram);
31 C_RESULT video_utils_close( video_controller_t* controller )
33 if( num_references > 0 )
37 if( num_references == 0 )
39 #if (VIDEO_DCT_USE_INTRAM == 1)
40 // Put in non cached INTRAM
41 controller->blockline_cache = NULL;
49 uint32_t ramcode_format_shifter_op_imm(uint32_t imm)
51 uint32_t shifter, imm8;
56 while( (imm8 & 0xFF) != imm8 )
62 if( (imm8 << (32-shifter*2)) != imm )
68 return (shifter << 8 | imm8);
71 C_RESULT video_utils_set_format( uint32_t width, uint32_t height )