Difference between revisions of "Porting Theora to 353 cameras"

From ElphelWiki
Jump to: navigation, search
(Interrupts)
Line 29: Line 29:
 
                 compressor_done_input,    // 6 - will go high after EOT and persist until DCT is enabled (reset by compressor)
 
                 compressor_done_input,    // 6 - will go high after EOT and persist until DCT is enabled (reset by compressor)
 
                 dcc_rdy,                  // 5 - obsolete in 333 - channel3 has 128 more dc coefficients (or some if the compression is finished)
 
                 dcc_rdy,                  // 5 - obsolete in 333 - channel3 has 128 more dc coefficients (or some if the compression is finished)
                 compressor_eot,          // 4 - compressor read in the last MCU (predictable time to end of transfer
+
                 compressor_eot,          // 4 - compressor read in the last MCU (predictable time to end of transfer)
 
                 sr_sensortrig[2],        // 3 - (sync to pclk) - level, reset by writing to sensor triggering command register
 
                 sr_sensortrig[2],        // 3 - (sync to pclk) - level, reset by writing to sensor triggering command register
 
                 xfer_over_irq,            // 2 - (sync to pclk) - frame acquisition over
 
                 xfer_over_irq,            // 2 - (sync to pclk) - frame acquisition over
 
                 trig_irq,                // 1 - (sync to pclk) - external trigger
 
                 trig_irq,                // 1 - (sync to pclk) - external trigger
 
                 vacts};                  // 0 - (sync to pclk) - frame sync
 
                 vacts};                  // 0 - (sync to pclk) - frame sync
 +
 +
353 MJPEG compressor triggers irqs 4, 6 and 7. 333 Theora compressor is the source of two irqs :
 +
'''compressor_all.v'''
 +
done,          // single-cycle pulse when the compressed frame is sent out (IRQ source).
 +
reset_compress, // reset compressor done interrupt (writing any compressor command)
 +
 +
Adaptation should consist of assigning Theora compressor irq sources to vectors 6 and 7 for example if the MJPEG compressor is to be replaced.
 +
  
 
=== Others ===
 
=== Others ===

Revision as of 01:10, 21 February 2008

Elphel model 333 cameras were able to encode and stream Ogg Theora with 6.3.9 firmware. However, this model is no longer produced by Elphel. The goal of this project is to use the full potential of 353 cameras (larger FPGA, faster CPU) in order to port the Ogg Theora feature on the new hardware. First, the camera should be able to upload small Theora clips via FTP.

Different solutions are possible as previously mentioned in the Theora page :

  • Instantiate both the Theora compressor and the MJPEG compressor in the FPGA since the new Spartan 3E seems to be large enough to handle the two features.
  • Replace the existing MJPEG compressor with the Theora compressor and implement software Theora to JPEG conversion if JPEG is needed.
  • Replace the existing MJPEG compressor in the 353 camera with the Theora compressor and keep two configuration files on the camera filesystem (one for Theora the other for MJPEG). FPGA code could be changed at run-time according to the needs.

Dealing with the last solution seems to be a good start for this project as the other features mentioned can be added later. In all cases, both FPGA code and software code will need to be adapted.


Hardware updates

Compressor

Replace the MJPEG compressor in the 353 with the 333 Theora compressor (333 Theora FPGA code). Maybe some adaptations need to be done within the Theora compressor itself. However, assuming that the compressor worked in 333 cameras a simple instantiation should suffice.

Memory controller

Replace the 4-channel memory controller with an 8-channel memory interface as in the 333 model in order to handle Theora specific data.

System Interface

Adapt the system interface to assure communication between FPGA and its environment.

Interrupts

Adapt the Theora compressor interrupts to the 353 interrupt vector .

The 353 interrupt vector can handle up to 16 different irq. However, only irq 0 to 8 are used :

x353.v
assign irq_in= {8'b0,                    // extra
               compressor_done_compress, // 7 - will go high after all data is sent out (reset by compressor)
               compressor_done_input,    // 6 - will go high after EOT and persist until DCT is enabled (reset by compressor)
               dcc_rdy,                  // 5 - obsolete in 333 - channel3 has 128 more dc coefficients (or some if the compression is finished)
               compressor_eot,           // 4 - compressor read in the last MCU (predictable time to end of transfer)
               sr_sensortrig[2],         // 3 - (sync to pclk) - level, reset by writing to sensor triggering command register
               xfer_over_irq,            // 2 - (sync to pclk) - frame acquisition over
               trig_irq,                 // 1 - (sync to pclk) - external trigger
               vacts};                   // 0 - (sync to pclk) - frame sync

353 MJPEG compressor triggers irqs 4, 6 and 7. 333 Theora compressor is the source of two irqs :

compressor_all.v
done,           // single-cycle pulse when the compressed frame is sent out (IRQ source).
reset_compress, // reset compressor done interrupt (writing any compressor command)

Adaptation should consist of assigning Theora compressor irq sources to vectors 6 and 7 for example if the MJPEG compressor is to be replaced.


Others

...?


Software updates

  • Adapt FPGA definitions (x353.h) and most likely some other FPGA drivers.
  • ...?



These lists of update are obviously incomplete. They need to be more detailed in order to make an exhaustive list of the changes that have to be done.

See also