@@ -738,11 +738,13 @@ if we know the roi for the entire GOP, we can pre-calculate the needed mbs at ev
738
738
static void compute_mb_mask_from_inter_frame_dependency (int p_videoFileIndex , int _stFrame , int _edFrame , int _stH , int _stW , int _edH , int _edW ) {
739
739
int l_i , l_j , l_k , l_m ;
740
740
int l_mbHeight , l_mbWidth ;
741
- FILE * tf ;
742
- tf = fopen ("test1.txt" , "w" );
741
+ //FILE *tf, *tf1;
742
+ //tf = fopen("test1.txt", "w");
743
+ //tf1 = fopen("test2.txt", "w");
743
744
l_mbHeight = (gVideoCodecCtxList [p_videoFileIndex ]-> height + 15 ) / 16 ;
744
745
l_mbWidth = (gVideoCodecCtxList [p_videoFileIndex ]-> width + 15 ) / 16 ;
745
746
LOGI (10 , "start of compute_mb_mask_from_inter_frame_dependency: %d, %d, [%d:%d] (%d, %d) (%d, %d)" , _stFrame , _edFrame , l_mbHeight , l_mbWidth , _stH , _stW , _edH , _edW );
747
+ //fprintf(tf1, "%d, %d, [%d:%d] (%d, %d) (%d, %d)", _stFrame, _edFrame, l_mbHeight, l_mbWidth, _stH, _stW, _edH, _edW);
746
748
memset (interDepMask , 0 , sizeof (interDepMask [0 ][0 ][0 ])* MAX_FRAME_NUM_IN_GOP * MAX_MB_H * MAX_MB_W );
747
749
//from last frame in the GOP, going backwards to the first frame of the GOP
748
750
//1. mark the roi as needed
@@ -757,20 +759,23 @@ static void compute_mb_mask_from_inter_frame_dependency(int p_videoFileIndex, in
757
759
//it's not necessary to process _stFrame, as there's no inter-dependency for it
758
760
// for (l_i = _edFrame; l_i >= _stFrame; --l_i) {
759
761
for (l_i = _edFrame ; l_i > _stFrame ; -- l_i ) {
762
+ interDepMapMove = interDepMap + (l_i - _stFrame )* l_mbHeight * l_mbWidth * 8 ;
760
763
//as we initialize the interDepMask to zero, we don't have a way to tell whether the upper left mb should be decoded, we always mark it as needed
761
764
interDepMask [l_i - 1 - _stFrame ][0 ][0 ] = 1 ;
762
765
for (l_j = 0 ; l_j < l_mbHeight ; ++ l_j ) {
763
766
for (l_k = 0 ; l_k < l_mbWidth ; ++ l_k ) {
767
+ //fprintf(tf, "%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d:\n", l_i, l_j, l_k, *interDepMapMove, *(interDepMapMove+1), *(interDepMapMove+2), *(interDepMapMove+3), *(interDepMapMove+4), *(interDepMapMove+5), *(interDepMapMove+6), *(interDepMapMove+7));
764
768
if (interDepMask [l_i - _stFrame ][l_j ][l_k ] == 1 ) {
769
+ // fprintf(tf1, "%d:%d:%d:\n", l_i, l_j, l_k);
765
770
for (l_m = 0 ; l_m < MAX_INTER_DEP_MB ; ++ l_m ) {
766
771
//LOGI(11, "%d,%d,%d,%d,%d,%d", l_i, l_j, l_k, l_m, *interDepMapMove, *(interDepMapMove+1));
767
- fprintf (tf , "%d,%d,%d,%d,%d,%d\n" , l_i , l_j , l_k , l_m , * interDepMapMove , * (interDepMapMove + 1 ));
768
772
//mark the needed mb in the previous frame
769
- if ((* interDepMapMove < 0 ) || (* (interDepMapMove + 1 ) < 0 )) {
770
- //continue;
771
- } else if ((* interDepMapMove == 0 ) && (* (interDepMapMove + 1 ) == 0 )) {
772
- //continue;
773
+ if (((* interDepMapMove ) < 0 ) || (* (interDepMapMove + 1 ) < 0 )) {
774
+ } else
775
+ if (((* interDepMapMove ) == 0 ) && (* (interDepMapMove + 1 ) == 0 )) {
773
776
} else {
777
+ //fprintf(tf, "%d,%d,%d,%d,%d,%d\n", l_i, l_j, l_k, l_m, *interDepMapMove, *(interDepMapMove+1));
778
+ //fprintf(tf, "%d,%d,%d,%d,%d\n", l_i, l_j, l_k, *interDepMapMove, *(interDepMapMove+1));
774
779
interDepMask [l_i - 1 - _stFrame ][* interDepMapMove ][* (interDepMapMove + 1 )] = 1 ;
775
780
}
776
781
interDepMapMove += 2 ;
@@ -781,7 +786,8 @@ static void compute_mb_mask_from_inter_frame_dependency(int p_videoFileIndex, in
781
786
}
782
787
}
783
788
}
784
- fclose (tf );
789
+ //fclose(tf);
790
+ //fclose(tf1);
785
791
LOGI (10 , "end of compute_mb_mask_from_inter_frame_dependency" );
786
792
}
787
793
@@ -901,7 +907,7 @@ void dep_decode_a_video_packet(int p_videoFileIndex) {
901
907
fclose (tmpF );
902
908
fclose (postF );
903
909
//[REMOVE]for verification of file: verified the content written to binary file is correct
904
- load_inter_frame_mb_dependency (p_videoFileIndex );
910
+ /* load_inter_frame_mb_dependency(p_videoFileIndex);
905
911
interDepMapMove = interDepMap;
906
912
sprintf(l_depInterFileName, "%s_inter_gop%d.txt.ver", gVideoFileNameList[p_videoFileIndex], gVideoPacketQueueList[p_videoFileIndex].dep_gop_num);
907
913
tmpF = fopen(l_depInterFileName, "w");
@@ -911,18 +917,18 @@ void dep_decode_a_video_packet(int p_videoFileIndex) {
911
917
for (k = 0; k < (gVideoCodecCtxList[p_videoFileIndex]->width + 15) / 16; ++k) {
912
918
fprintf(tmpF, "%d:%d:%d:", i, j, k);
913
919
for (m = 0; m < 4; ++m) {
914
- if ((* interDepMapMove == 0 ) && (* (interDepMapMove + 1 ) == 0 )) {
915
- } else {
920
+ // if ((*interDepMapMove == 0) && (*(interDepMapMove+1) == 0)) {
921
+ // } else {
916
922
fprintf(tmpF, "%d:%d:", *interDepMapMove, *(interDepMapMove+1));
917
- }
923
+ // }
918
924
interDepMapMove += 2;
919
925
}
920
926
fprintf(tmpF, "\n");
921
927
}
922
928
}
923
929
}
924
930
fclose(tmpF);
925
- fclose (postF );
931
+ fclose(postF);*/
926
932
//post processing for intra-frame dependency
927
933
sprintf (l_depIntraFileName , "%s_intra_gop%d.txt.tmp" , gVideoFileNameList [p_videoFileIndex ], gVideoPacketQueueList [p_videoFileIndex ].dep_gop_num );
928
934
sprintf (gVideoCodecCtxDepList [p_videoFileIndex ]-> g_intraDepFileName , "%s_intra_gop%d.txt" , gVideoFileNameList [p_videoFileIndex ], gVideoPacketQueueList [p_videoFileIndex ].dep_gop_num );
0 commit comments