Project Name: JPEG-MJPEG_BF533.dpj Project Type: ADSP-BF533 [X] ADSP-BF537 [ ] ADSP-BF561 [ ] Hardware/Tools Used:(Please refer release notes for information on supported hardware/tool versions) ************************************** ************************************** *** PLEASE READ THE RELEASE NOTE *** *** FOR SPECIFIC HARDWARE AND *** *** SOFTWARE CONFIGURATIONS *** *** SUPPORTED BY THIS APPLICATION *** ************************************** ************************************** ADSP-BF533 EZ-Kit Lite Blackfin USB-LAN EZ-Extender Analog Devices VisualDSP++ VisualDSP++ Emulator TV with NTSC/PAL AV input DVD player with NTSC/PAL Output System Services Components Used: DMA Manager [X] Deferred Callback Manager [X] Interrupt Manager [X] Timer Module [X] Power Management Module [X] Flag Module [X] External Bus Interface Unit Module [X] Port Module [X] OVERVIEW ========= This application can - Decode a JPEG/MJPEG file from PC and render it to a video monitor. - Capture video, encode it to JPEG/MJPEG file and store it in a PC location. The application supports decoding JPEG/MJPEG files of YUV420 format, converts it to ITU656 NTSC/PAL interlaced video frame(s) and renders to video monitor (Television) through ADV7171 video encoder. The application supports encoding ITU656 NTSC/PAL interlaced video to JPEG/MJPEG file and stores it to a PC location. The video source can be a DVD player in NTSC/PAL video output mode. The video input to the firmware is decoded by ADV7183 video decoder. Video Modes: ------------ This application supports encoding ITU656 NTSC/PAL interlaced video input to JPEG/MJPEG file(s). The application automatically detects the type of video input before starting an encoding process. All JPEG/MJPEG files will be encoded to YUV 420 format. The application can decode JPEG/MJPEG files of YUV 420 format, build ITU656 NTSC or PAL interlaced video frame and render it to a video monitor (Television). Output video mode can be selected via JPEG-MJPEG configuration mode from 'pc2bf.exe' (Host Interface). JPEG/MJPEG Files: ----------------- Below options can be seleted via JPEG-MJPEG configuration mode from 'pc2bf.exe' (Host interface). Option 1: Prompt for JPEG/MJPEG file name and encoding parameters. --------- With this option selected, the Host interface will prompt for directory path where the JPEG/MJPEG files reside and JPEG/MJPEG file name(s) to encode/decode. In encoding mode, the application will also prompt user to enter encoding parameters such as Image width, Image Height and Quality Factor for each JPEG/MJPEG file to be encoded. Option2: Read JPEG/MJPEG file name and encoding parameters from '.txt' file. -------- In this mode, the application will look for JPEG files kept in "Media\JPEG\" and MJPEG files in "Media\MJPEG\" directories. If the application runs in encoding mode, the resulting encoded files will also go into these directories. There are four text files in "Multimedia\JPEG-MJPEG\" directory and these files instruct the kit what files to decode and encode. Hardware Support: ----------------- This application can interface only with onboard video codecs on ADSP-BF533 EZ-Kit Lite Conditional compilation Macros: ------------------------------- To enable any of the following mode/function, the corresponding macro should be defined in preprocessor definitions section under 'JPEG-MJPEG_BF533.dpj' project options. (Project -> Project Options - Project - Compile - Preprocessor - Preprocessor definitions) ADI_MMSK_EXTRA_INFO - Displays additional debug information Pc to Blackfin Communication: ----------------------------- Communication between Blackfin and PC is established via USB, using Blackfin USB-LAN EZ-Extender. RUNNING THE APPLICATION ======================= 1.Video interface with ADSP-BF533 EZ-KIT Lite codecs --------------------------------------------------- Connect Blackfin USB-LAN EZ-Extender on top of ADSP-BF533 EZ-KIT Lite -- BF533 Ez Kit -- SW1: 1-OFF 2-OFF 3-OFF 4-OFF 5-OFF 6-OFF SW2: 1-OFF 2-OFF 3-OFF 4-OFF 5-OFF 6-OFF SW3: 1-OFF 2-OFF 3-OFF 4-OFF 5-OFF 6-ON SW9: 1-ON 2-OFF 3-OFF 4-OFF 5-OFF 6-ON SW10 1-ON 2-ON SW11 1-OFF 2-ON SW12 1-ON 2-ON 3-ON 4-ON -- Blackfin USB-LAN EZ-Extender -- SW1: 1 ON 2 ON 3 ON 4 OFF SW2: 1 OFF 2 OFF 3 OFF 4 OFF 2. ADSP-BF533 EZ-KIT Lite - Push Button functions ------------------------------------------------- Push Button 1 (SW4): Encode JPEG image or Start/End encoding MJPEG stream Push Button 2 (SW5): Not used Push Button 3 (SW6): Not used Push Button 4 (SW7): Not used 3. External connections: ------------------------ Connect a monitor to the EZ-Kit video-out connector and a video source to the EZ-Kit video-in. The video connectors are the bank of 6 RCA-style jacks Video interface with onboard video codecs in ADSP-BF533 EZ-Kit Lite -------------------------------------------------------------------- RCA-style jacks labeled J8 J8 +---------------------------------------------------+ | O O < Video Out O | (White) | O O O < Video In | (Red) +---------------------------------------------------+ 4. PC Host application: pc2bf.exe ---------------------------------- The host application (pc2bf.exe) that runs on a PC is used for streaming data to and from the EZKit. This application supports following options 1 - Decode JPEG file and render to a display device 2 - Decode MJPEG file and render to a display device 3 - Capture a video frame and encode to JPEG file 4 - Capture streaming video and encode to MJPEG file 5 - to change JPEG/MJPEG Encoder/Decoder settings Q - Quit the PC Host Application Option 1: Decodes JPEG file selected by the user during run-time (or) Cycles through all the JPEG images listed in Multimedia\JPEG-MJPEG\jpeg_list.txt. Converts the decoded JPEG file to ITU656 NTSC/PAL video frame and renders it to a video monitor (Television). Option 2: Decodes MJPEG file selected by the user during run-time (or) Cycles through all the MJPEG images listed in Multimedia\JPEG-MJPEG\mjpeg_list.txt. Converts the decoded MJPEG file to ITU656 NTSC/PAL video frame and renders it to a video monitor (Television). Option 3: Prints out some instructions in the console window for user to follow. The user is required to press SW6 button on ADSP-BF533 EZ-Kit Lite to capture a video frame and store it as a JPEG file Option 4: Prints out some instructions in the console window for user to follow. The user is required to press SW6 button on ADSP-BF533 EZ-Kit Lite to start and stop the MJPEG encoding. Option 5: Enters JPEG-MJPEG configuration mode. This mode allows user to -> Select a video source (ITU656 by default) -> Select a video output format (ITU656 NTSC by default) -> Select JPEG/MJPEG encoder - encoding file mode (YUV 420 by default) -> Select JPEG/MJPEG File location and associated parameters (read from .txt file by default) Option Q: Quits PC Host application 5. Syntax for specifying encoding parameters --------------------------------------------- JPEG/MJPEG Encoding parameters are specified in jpeg_encoder_spec.txt and mjpeg_encoder_spec.txt files respectively Syntax: Outputfilename width height Q-factor Where, Outputfilename is the filename of the encoded sequence width and height are the width and the height of the frame in pixels Q-factor is the quality factor of the encoding Example for JPEG encoding: my_picture.jpg 352 288 50 This would encode a CIF sized JPEG file (352x288) at a quality factor of 50 to a file named my_picture.jpg. Example for Encoding a MJPEG sequence: my_sequence.avi 640 480 40 This would result in the encoding of a VGA resolution sequence at quality factor of 40 to a file my_sequence.avi. Typically, Q factors of 80~90 or less are used. Since there is little quality gain at Q-factors above 90, it is debatable whether these gains justify the significant increase in file sizes and in MIPS. 6. Operational Description --------------------------- - Open the "JPEG-MJPEG_BF533.dpj" project in the VisualDSP Integrated Development Environment (IDDE). - Build the project by selecting "rebuild all" from the project menu. The project gets automatically loaded in to DSP - Connect USB port from PC to the USB port of the Blackfin USB-LAN Ez-Extender with the given USB cable - Connect a video display monitor (Television) to the video output jack (white coloured RCA-style jack) - Connect a ITU656 NTSC/PAL interlaced video source (DVD player) to video input jack (red coloured RCA-style jack) - Run the executable by pressing "run" (F5) on the toolbar. If this is the first time the program is run, Windows will claim to have detected new hardware, and prompt for a driver. The driver is located in "BlackfinSDK\Tools\Windows Drivers\USB-LAN EZ-EXTENDER BULK USB" directory. Once installed, Windows will not ask for the driver again the next time the application is run. - Once the program starts running, the user should give the EZ-Kit and the PC a few seconds to initialize and install the USB driver, before using the host application (Bin\pc2bf.exe) References: ----------- Multiformat SDTV Video Decoder ADV7183B Reference Manual ADV7171 Video Encoder Reference Manual ADSP-BF533 Hardware Reference Manual ADSP-BF533 EZ-Kit Lite Evaluation system manual Blackfin USB-LAN EZ-Extender schematic David J.Katz, Rick Gentile, "Embedded Media Processing", 2d ed. New York:Elsevier Inc., 2006, ISBN:0750679123