OpenCores
URL https://opencores.org/ocsvn/bluespec-h264/bluespec-h264/trunk

Subversion Repositories bluespec-h264

[/] [bluespec-h264/] [trunk/] [src/] [mkPrediction.bsv] - Diff between revs 9 and 13

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 9 Rev 13
Line 294... Line 294...
               firstMb   <= xdata;
               firstMb   <= xdata;
               currMb    <= xdata;
               currMb    <= xdata;
               currMbHor <= xdata;
               currMbHor <= xdata;
               currMbVer <= 0;
               currMbVer <= 0;
               intra4x4typeLeft <= replicate(15);
               intra4x4typeLeft <= replicate(15);
               interTopLeftVal <= replicate(NotInter 0);
               interTopLeftVal <= replicate(NotInter (0));
               if(xdata==0)
               if(xdata==0)
                  interLeftVal <= replicate(NotInter 0);
                  interLeftVal <= replicate(NotInter (0));
               outFirstQPFlag <= True;
               outFirstQPFlag <= True;
            end
            end
         tagged SDmb_skip_run .xdata : passFlag <= False;
         tagged SDmb_skip_run .xdata : passFlag <= False;
         tagged SDMmbtype .xdata : passFlag <= False;
         tagged SDMmbtype .xdata : passFlag <= False;
         tagged EndOfFile :
         tagged EndOfFile :
Line 335... Line 335...
                                 interstate <= InterPskip;
                                 interstate <= InterPskip;
                                 interReqCount <= 1;
                                 interReqCount <= 1;
                                 interRespCount <= 1;
                                 interRespCount <= 1;
                                 intra4x4typeLeft <= replicate(14);
                                 intra4x4typeLeft <= replicate(14);
                                 intra4x4typeTop <= replicate(14);
                                 intra4x4typeTop <= replicate(14);
                                 interTopLeftVal <= update(interTopLeftVal , 0, (NotInter 0));
                                 interTopLeftVal <= update(interTopLeftVal , 0, (NotInter (0)));
                                 interTopVal <= replicate(NotInter 0);
                                 interTopVal <= replicate(NotInter (0));
                                 interPskipCount <= interPskipCount+1;
                                 interPskipCount <= interPskipCount+1;
                                 interNewestMv <= 0;
                                 interNewestMv <= 0;
                                 interRefIdxVector <= replicate(0);
                                 interRefIdxVector <= replicate(0);
                                 interCurrMbDiff <= interCurrMbDiff+1;
                                 interCurrMbDiff <= interCurrMbDiff+1;
                                 nextoutputfifo.enq(SkipMB);
                                 nextoutputfifo.enq(SkipMB);
Line 374... Line 374...
                                    intra16x16_pred_mode <= tempv1;
                                    intra16x16_pred_mode <= tempv1;
                                 else
                                 else
                                    $display( "ERROR Prediction: MacroblockLayer 5 sdmmbtype not I_16x16" );
                                    $display( "ERROR Prediction: MacroblockLayer 5 sdmmbtype not I_16x16" );
                                 intraReqCount <= 1;
                                 intraReqCount <= 1;
                                 intraRespCount <= 1;
                                 intraRespCount <= 1;
                                 interTopLeftVal <= replicate(NotInter 1);
                                 interTopLeftVal <= replicate(NotInter (1));
                                 interLeftVal <= replicate(NotInter 1);
                                 interLeftVal <= replicate(NotInter (1));
                                 interTopVal <= replicate(NotInter 1);
                                 interTopVal <= replicate(NotInter (1));
                              end
                              end
                           else
                           else
                              donotfire.doNotFire();
                              donotfire.doNotFire();
                        end
                        end
                     else if(xdata==I_NxN)
                     else if(xdata==I_NxN)
Line 389... Line 389...
                              begin
                              begin
                                 outstatefifo.enq(Intra4x4);
                                 outstatefifo.enq(Intra4x4);
                                 intrastate <= Intra4x4;
                                 intrastate <= Intra4x4;
                                 intraReqCount <= 1;
                                 intraReqCount <= 1;
                                 intraRespCount <= 1;
                                 intraRespCount <= 1;
                                 interTopLeftVal <= replicate(NotInter 1);
                                 interTopLeftVal <= replicate(NotInter (1));
                                 interLeftVal <= replicate(NotInter 1);
                                 interLeftVal <= replicate(NotInter (1));
                                 interTopVal <= replicate(NotInter 1);
                                 interTopVal <= replicate(NotInter (1));
                              end
                              end
                           else
                           else
                              donotfire.doNotFire();
                              donotfire.doNotFire();
                        end
                        end
                     else if(xdata==I_PCM)
                     else if(xdata==I_PCM)
                        begin
                        begin
                           $display( "ERROR Prediction: I_PCM not implemented yet");
                           $display( "ERROR Prediction: I_PCM not implemented yet");
                           $finish;////////////////////////////////////////////////////////////////////////////////////////
                           $finish;////////////////////////////////////////////////////////////////////////////////////////
                           intra4x4typeLeft <= replicate(13);
                           intra4x4typeLeft <= replicate(13);
                           intra4x4typeTop <= replicate(13);
                           intra4x4typeTop <= replicate(13);
                           interTopLeftVal <= replicate(NotInter 1);
                           interTopLeftVal <= replicate(NotInter (1));
                           interLeftVal <= replicate(NotInter 1);
                           interLeftVal <= replicate(NotInter (1));
                           interTopVal <= replicate(NotInter 1);
                           interTopVal <= replicate(NotInter (1));
                        end
                        end
                     else
                     else
                        begin
                        begin
                           if(!outstatefifo.notEmpty() || interCurrMbDiff
                           if(!outstatefifo.notEmpty() || interCurrMbDiff
                              begin
                              begin
Line 423... Line 423...
                                 endcase
                                 endcase
                                 interReqCount <= 1;
                                 interReqCount <= 1;
                                 interRespCount <= 1;
                                 interRespCount <= 1;
                                 intra4x4typeLeft <= replicate(14);/////////////////////////////////////////////////////////////////////////////
                                 intra4x4typeLeft <= replicate(14);/////////////////////////////////////////////////////////////////////////////
                                 intra4x4typeTop <= replicate(14);
                                 intra4x4typeTop <= replicate(14);
                                 interTopLeftVal <= update(interTopLeftVal , 0, (NotInter 0));
                                 interTopLeftVal <= update(interTopLeftVal , 0, (NotInter (0)));
                                 interTopVal <= replicate(NotInter 0);
                                 interTopVal <= replicate(NotInter (0));
                                 interNewestMv <= 0;
                                 interNewestMv <= 0;
                                 interRefIdxVector <= replicate(0);
                                 interRefIdxVector <= replicate(0);
                                 nextoutputfifo.enq(NonSkipMB);
                                 nextoutputfifo.enq(NonSkipMB);
                              end
                              end
                           else
                           else
Line 549... Line 549...
               end
               end
            else
            else
               begin
               begin
                  interBSoutput <= True;
                  interBSoutput <= True;
                  outputVector = predictedfifo.first();
                  outputVector = predictedfifo.first();
                  outfifo.enq(PBoutput outputVector);
                  outfifo.enq(PBoutput (outputVector));
                  outputFlag = 1;
                  outputFlag = 1;
                  predictedfifo.deq();
                  predictedfifo.deq();
                  $display( "Trace Prediction: outputing SkipMB out %h %h %h", outBlockNum, outPixelNum, outputVector);
                  $display( "Trace Prediction: outputing SkipMB out %h %h %h", outBlockNum, outPixelNum, outputVector);
               end
               end
         end
         end
Line 599... Line 599...
                                 else if(tempOutputValue[9:0] > 255)
                                 else if(tempOutputValue[9:0] > 255)
                                    outputVector[ii] = 255;
                                    outputVector[ii] = 255;
                                 else
                                 else
                                    outputVector[ii] = tempOutputValue[7:0];
                                    outputVector[ii] = tempOutputValue[7:0];
                              end
                              end
                           outfifo.enq(PBoutput outputVector);
                           outfifo.enq(PBoutput (outputVector));
                           infifo_ITB.deq();
                           infifo_ITB.deq();
                           predictedfifo.deq();
                           predictedfifo.deq();
                           outputFlag = 1;
                           outputFlag = 1;
                           $display( "Trace Prediction: outputing ITBresidual out %h %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), xdata, outputVector);
                           $display( "Trace Prediction: outputing ITBresidual out %h %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), xdata, outputVector);
                        end
                        end
Line 632... Line 632...
                        begin
                        begin
                           interBSoutput <= True;
                           interBSoutput <= True;
                           if(outPixelNum == 12)
                           if(outPixelNum == 12)
                              infifo_ITB.deq();
                              infifo_ITB.deq();
                           outputVector = predictedfifo.first();
                           outputVector = predictedfifo.first();
                           outfifo.enq(PBoutput outputVector);
                           outfifo.enq(PBoutput (outputVector));
                           outputFlag = 1;
                           outputFlag = 1;
                           predictedfifo.deq();
                           predictedfifo.deq();
                           $display( "Trace Prediction: outputing ITBcoeffLevelZeros out %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), outputVector);
                           $display( "Trace Prediction: outputing ITBcoeffLevelZeros out %h %h %h %h %h", outChromaFlag, outBlockNum, outPixelNum, predictedfifo.first(), outputVector);
                        end
                        end
                  end
                  end
Line 847... Line 847...
            else
            else
               noMoreReq = True;
               noMoreReq = True;
         end
         end
      if(!noMoreReq)
      if(!noMoreReq)
         begin
         begin
            interMemReqQ.enq(LoadReq temp);
            interMemReqQ.enq(LoadReq (temp));
            interReqCount <= interReqCount+1;
            interReqCount <= interReqCount+1;
            //$display( "TRACE Prediction: interSendReq addr %0d",temp);///////////////////////
            //$display( "TRACE Prediction: interSendReq addr %0d",temp);///////////////////////
         end
         end
      else
      else
         interReqCount <= 0;
         interReqCount <= 0;
Line 866... Line 866...
      interRespCount <= 0;
      interRespCount <= 0;
      interStepCount <= 1;
      interStepCount <= 1;
      interIPStepCount <= 1;
      interIPStepCount <= 1;
      if(currMbHorTemp == 0)
      if(currMbHorTemp == 0)
         begin
         begin
            interLeftVal <= replicate(NotInter 0);
            interLeftVal <= replicate(NotInter (0));
            interTopLeftVal <= replicate(NotInter 0);
            interTopLeftVal <= replicate(NotInter (0));
         end
         end
      $display( "Trace Prediction: interReceiveNoResp %h %h", interstate, interRespCount);
      $display( "Trace Prediction: interReceiveNoResp %h %h", interstate, interRespCount);
   endrule
   endrule
 
 
 
 
Line 921... Line 921...
            interRespCount <= 0;
            interRespCount <= 0;
            interStepCount <= 1;
            interStepCount <= 1;
            interIPStepCount <= 1;
            interIPStepCount <= 1;
            if(currMbHorTemp == 0)
            if(currMbHorTemp == 0)
               begin
               begin
                  interLeftVal <= replicate(NotInter 0);
                  interLeftVal <= replicate(NotInter (0));
                  interTopLeftValNext = replicate(NotInter 0);
                  interTopLeftValNext = replicate(NotInter (0));
               end
               end
         end
         end
      interTopVal <= interTopValNext;
      interTopVal <= interTopValNext;
      interTopLeftVal <= interTopLeftValNext;
      interTopLeftVal <= interTopLeftValNext;
      $display( "Trace Prediction: interReceiveResp %h %h %h", interstate, interRespCount, data);
      $display( "Trace Prediction: interReceiveResp %h %h %h", interstate, interRespCount, data);
Line 1013... Line 1013...
            endcase
            endcase
         end
         end
      else
      else
         $display( "ERROR Prediction: interProcessStep unexpected interstate");
         $display( "ERROR Prediction: interProcessStep unexpected interstate");
      Bit#(4) refIndex = ((interstate==InterPskip||interstate==InterP8x8ref0) ? 0 : interRefIdxVector[interMbPartNum]);
      Bit#(4) refIndex = ((interstate==InterPskip||interstate==InterP8x8ref0) ? 0 : interRefIdxVector[interMbPartNum]);
      Vector#(3,InterBlockMv) blockABC = replicate(NotInter 0);
      Vector#(3,InterBlockMv) blockABC = replicate(NotInter (0));
      if( currMbTemp-firstMb==0 && blockHor==0 )
      if( currMbTemp-firstMb==0 && blockHor==0 )
         blockABC[0] = (NotInter 0);
         blockABC[0] = (NotInter (0));
      else
      else
         blockABC[0] = interLeftVal[blockVer];
         blockABC[0] = interLeftVal[blockVer];
      if( currMbTemp-firstMb
      if( currMbTemp-firstMb
         blockABC[1] = (NotInter 0);
         blockABC[1] = (NotInter (0));
      else
      else
         blockABC[1] = interTopVal[blockHor];
         blockABC[1] = interTopVal[blockHor];
      blockABC[2] = interTopVal[{1'b0,blockHor}+partWidth];
      blockABC[2] = interTopVal[{1'b0,blockHor}+partWidth];
      if(noBlockC || blockABC[2]==(NotInter 0))
      if(noBlockC || blockABC[2]==(NotInter (0)))
         blockABC[2] = interTopLeftVal[blockVer];
         blockABC[2] = interTopLeftVal[blockVer];
      Bit#(14) mvhorfinal = 0;
      Bit#(14) mvhorfinal = 0;
      Bit#(12) mvverfinal = 0;
      Bit#(12) mvverfinal = 0;
      Bit#(5) interNewestMvNext = 0;
      Bit#(5) interNewestMvNext = 0;
      if(calcmv)//motion vector caculation
      if(calcmv)//motion vector caculation
Line 1081... Line 1081...
                                 begin
                                 begin
                                    mvhorPred = 0;
                                    mvhorPred = 0;
                                    mvverPred = 0;
                                    mvverPred = 0;
                                 end
                                 end
                           end
                           end
                        else if(blockABC[ii] matches tagged NotInter 0)
                        else if(blockABC[ii] matches tagged NotInter (0))
                           begin
                           begin
                              mvhorPred = 0;
                              mvhorPred = 0;
                              mvverPred = 0;
                              mvverPred = 0;
                           end
                           end
                     end
                     end
Line 1356... Line 1356...
            else
            else
               noMoreReq = 1;
               noMoreReq = 1;
         end
         end
      if(noMoreReq == 0)
      if(noMoreReq == 0)
         begin
         begin
            intraMemReqQ.enq(LoadReq temp);
            intraMemReqQ.enq(LoadReq (temp));
            intraReqCount <= intraReqCount+1;
            intraReqCount <= intraReqCount+1;
            //$display( "TRACE Prediction: intraSendReq addr %0d",temp);///////////////////////
            //$display( "TRACE Prediction: intraSendReq addr %0d",temp);///////////////////////
         end
         end
      else
      else
         intraReqCount <= 0;
         intraReqCount <= 0;
Line 1372... Line 1372...
      intra4x4typeTop <= replicate(15);
      intra4x4typeTop <= replicate(15);
      intraRespCount <= 0;
      intraRespCount <= 0;
      intraStepCount <= 1;
      intraStepCount <= 1;
      blockNum <= 0;
      blockNum <= 0;
      pixelNum <= 0;
      pixelNum <= 0;
      interOutBlockMvfifo.enq(NotInter 1);
      interOutBlockMvfifo.enq(NotInter (1));
      $display( "Trace Prediction: intraReceiveNoResp");
      $display( "Trace Prediction: intraReceiveNoResp");
   endrule
   endrule
 
 
 
 
   rule intraReceiveResp ( intraRespCount>0 && intraRespCount<7 && currMbHor
   rule intraReceiveResp ( intraRespCount>0 && intraRespCount<7 && currMbHor
Line 1434... Line 1434...
         begin
         begin
            intraRespCount <= 0;
            intraRespCount <= 0;
            intraStepCount <= 1;
            intraStepCount <= 1;
            blockNum <= 0;
            blockNum <= 0;
            pixelNum <= 0;
            pixelNum <= 0;
            interOutBlockMvfifo.enq(NotInter 1);
            interOutBlockMvfifo.enq(NotInter (1));
         end
         end
      $display( "Trace Prediction: intraReceiveResp");
      $display( "Trace Prediction: intraReceiveResp");
   endrule
   endrule
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.