[mythtv] FFmpeg sync

Erik Hovland erik at hovland.org
Thu Sep 18 19:35:01 UTC 2008


On Wed, Sep 17, 2008 at 06:51:39PM -0600, John P Poet wrote:
> > I have not tried 1080i H.264.  I have been avoiding it because of all
> > the segfaults.  I will try to remember to give that a shot tonight
> > with the new code, to see if it is improved.
> 
> Even with this patch applied, trying to watch 1080i HD-PVR generated
> h.264 material causes mythfrontend to crash, right after:
> 
> 2008-09-17 18:46:35.049 [h264 @ 0xb7375180]Cannot parallelize
> deblocking type 1, decoding such frames in sequential order

I have a few patches that attempt to fix defects in h264.c in ffmpeg
trunk. I have no idea if they will help the problem you keep running
into, but they are attached to this email if you want to give them a
try.

E

-- 
Erik Hovland
mail: erik at hovland.org
web: http://hovland.org/
PGP/GPG public key available on request
-------------- next part --------------
Attempts to fix initialization errors.

From: Erik Hovland <erik at hovland.org>


---

 libavcodec/h264.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 018cc92..8f05c21 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2723,7 +2723,7 @@ static int add_sorted(Picture **sorted, Picture **src, int len, int limit, int d
                 sorted[out_i]= src[i];
             }
         }
-        if(best_poc == (dir ? INT_MIN : INT_MAX))
+        if(sorted[out_i] == NULL || best_poc == (dir ? INT_MIN : INT_MAX))
             break;
         limit= sorted[out_i++]->poc - dir;
     }
@@ -2742,6 +2742,7 @@ static int fill_default_ref_list(H264Context *h){
         int cur_poc, list;
         int lens[2];
 
+        memset(sorted, 0, sizeof(sorted));
         if(FIELD_PICTURE)
             cur_poc= s->current_picture_ptr->field_poc[ s->picture_structure == PICT_BOTTOM_FIELD ];
         else
-------------- next part --------------
h264_parser.h does not have any useful symbols for h264.c

From: Erik Hovland <erik at hovland.org>


---

 libavcodec/h264.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 8f05c21..2befc10 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -30,7 +30,6 @@
 #include "mpegvideo.h"
 #include "h264.h"
 #include "h264data.h"
-#include "h264_parser.h"
 #include "golomb.h"
 #include "rectangle.h"
 
-------------- next part --------------
s->current_picture_ptr might be accessed when it still might be null.

From: Erik Hovland <erik at hovland.org>


---

 libavcodec/h264.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 2befc10..14dd51e 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3764,7 +3764,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
             frame_start(h);
             h->prev_frame_num++;
             h->prev_frame_num %= 1<<h->sps.log2_max_frame_num;
-            s->current_picture_ptr->frame_num= h->prev_frame_num;
+            if (s->current_picture_ptr)
+                s->current_picture_ptr->frame_num= h->prev_frame_num;
+
             execute_ref_pic_marking(h, NULL, 0);
         }
 
@@ -3816,7 +3818,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
     if(h != h0)
         clone_slice(h, h0);
 
-    s->current_picture_ptr->frame_num= h->frame_num; //FIXME frame_num cleanup
+    if (s->current_picture_ptr)
+        s->current_picture_ptr->frame_num= h->frame_num; //FIXME frame_num cleanup
 
     assert(s->mb_num == s->mb_width * s->mb_height);
     if(first_mb_in_slice << FIELD_OR_MBAFF_PICTURE >= s->mb_num ||
-------------- next part --------------
chroma_dc_total_zeros_vlc has only 3 entries. total_entries could

From: Erik Hovland <erik at hovland.org>

be larger.
---

 libavcodec/h264.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 14dd51e..9a49550 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -4158,7 +4158,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
         }
     }
 
-    if(total_coeff == max_coeff)
+    if(total_coeff == max_coeff || total_coeff > 2)
         zeros_left=0;
     else{
         if(n == CHROMA_DC_BLOCK_INDEX)


More information about the mythtv-dev mailing list