summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/OMXCodec.cpp
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-09-14 10:36:53 -0700
committerJames Dong <jdong@google.com>2012-09-14 10:36:53 -0700
commit08654f9d7157f6d6ca0928cb438bbbed53fb0fd1 (patch)
tree1f1776783eb72604cdffe5eb1728de132433fa67 /media/libstagefright/OMXCodec.cpp
parent2637cb172105939052d8a02f4eea693a90549518 (diff)
downloadframeworks_av-08654f9d7157f6d6ca0928cb438bbbed53fb0fd1.zip
frameworks_av-08654f9d7157f6d6ca0928cb438bbbed53fb0fd1.tar.gz
frameworks_av-08654f9d7157f6d6ca0928cb438bbbed53fb0fd1.tar.bz2
Make a small correction in terms of GOP structure in the recorded video
When we have a 30 fps frame rate, and one second key-frame or I-frame interval, we really would like to have for each second, 29 P-frames + 1 I-frame. Thus, we should calculate the number of P frames so that it is equal to frame_rate * I_frame_interval - 1 Change-Id: I5b9be6e4c101e7a6b718015aa4041496961c0f19
Diffstat (limited to 'media/libstagefright/OMXCodec.cpp')
-rwxr-xr-xmedia/libstagefright/OMXCodec.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/libstagefright/OMXCodec.cpp b/media/libstagefright/OMXCodec.cpp
index 233a733..07f92c7 100755
--- a/media/libstagefright/OMXCodec.cpp
+++ b/media/libstagefright/OMXCodec.cpp
@@ -890,7 +890,7 @@ static OMX_U32 setPFramesSpacing(int32_t iFramesInterval, int32_t frameRate) {
} else if (iFramesInterval == 0) {
return 0;
}
- OMX_U32 ret = frameRate * iFramesInterval;
+ OMX_U32 ret = frameRate * iFramesInterval - 1;
CHECK(ret > 1);
return ret;
}