[Vorbis-dev] Is it possible to seek different Ogg Vorbis encoded packets from the File?

Niranjan Udipi ucniranjan at gmail.com
Thu Oct 22 00:23:22 PDT 2009


Hi All,

    I am trying to program the 'Tremor' decoder onto an array of Processors.
I am using four Processors.

    I did this experiment: I split the while(!eof){} in the main() in to
four tasks using if(!eof) statements. In this modification, each if()
decodes one packet of data at-a-time, sequentially. Then, I ran the code on
a single Processor and the decoding was successful. The changes in the
ivorbisfile_example.c are as follows:

while(!eof){
    long ret=ov_read(&vf,pcmout,sizeof(pcmout),&current_section);
    if (ret == 0) {
      /* EOF */
      eof=1;
    } else if (ret < 0) {
      /* error in the stream.  Not a problem, just reporting it in
     case we (the app) cares.  In this case, we don't. */
    } else {
      /* we don't bother dealing with sample rate changes, etc, but
     you'll have to*/
      fwrite(pcmout,1,ret,fp1);
    }
    if(eof)
    {
        break;
    }
    else
    {
     long ret=ov_read(&vf,pcmout,sizeof(pcmout),&current_section);
    if (ret == 0) {
      /* EOF */
      eof=1;
    } else if (ret < 0) {
      /* error in the stream.  Not a problem, just reporting it in
     case we (the app) cares.  In this case, we don't. */
    } else {
      /* we don't bother dealing with sample rate changes, etc, but
     you'll have to*/
      fwrite(pcmout,1,ret,fp1);
    }
}
if(eof)
    {
        break;
    }
    else
    {
     long ret=ov_read(&vf,pcmout,sizeof(pcmout),&current_section);
    if (ret == 0) {
      /* EOF */
      eof=1;
    } else if (ret < 0) {
      /* error in the stream.  Not a problem, just reporting it in
     case we (the app) cares.  In this case, we don't. */
    } else {
      /* we don't bother dealing with sample rate changes, etc, but
     you'll have to*/
      fwrite(pcmout,1,ret,fp1);
    }
}
if(eof)
    {
        break;
    }
    else
    {
     long ret=ov_read(&vf,pcmout,sizeof(pcmout),&current_section);
    if (ret == 0) {
      /* EOF */
      eof=1;
    } else if (ret < 0) {
      /* error in the stream.  Not a problem, just reporting it in
     case we (the app) cares.  In this case, we don't. */
    } else {
      /* we don't bother dealing with sample rate changes, etc, but
     you'll have to*/
      fwrite(pcmout,1,ret,fp1);
    }
}


     However, in order to run the decoder parallely on four Processors, I
need to run the ov_read() function on each Processor independently. In order
to do that each Processor should be able to seek next encoded packet of data
and there should not be duplication of packet decoding.

     Is it known apriori, how many Ogg-Vorbis packets are there and their
corresponding locations in the File/stream? If yes, then each Processor can
be pointed to its packet to-be-decoded. Please suggest how I can go ahead?

Thanks,
Niranjan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/vorbis-dev/attachments/20091022/f32899ac/attachment.htm 


More information about the Vorbis-dev mailing list