| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. | 3 * Copyright (c) 2012 The WebM project authors. All Rights Reserved. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license | 5 * Use of this source code is governed by a BSD-style license |
| 6 * that can be found in the LICENSE file in the root of the source | 6 * that can be found in the LICENSE file in the root of the source |
| 7 * tree. An additional intellectual property rights grant can be found | 7 * tree. An additional intellectual property rights grant can be found |
| 8 * in the file PATENTS. All contributing project authors may | 8 * in the file PATENTS. All contributing project authors may |
| 9 * be found in the AUTHORS file in the root of the source tree. | 9 * be found in the AUTHORS file in the root of the source tree. |
| 10 */ | 10 */ |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 xd->mi_stride].src_mi->mbmi; | 62 xd->mi_stride].src_mi->mbmi; |
| 63 different_ref_found = 1; | 63 different_ref_found = 1; |
| 64 | 64 |
| 65 if (candidate->ref_frame[0] == ref_frame) | 65 if (candidate->ref_frame[0] == ref_frame) |
| 66 ADD_MV_REF_LIST(candidate->mv[0], refmv_count, mv_ref_list, Done); | 66 ADD_MV_REF_LIST(candidate->mv[0], refmv_count, mv_ref_list, Done); |
| 67 else if (candidate->ref_frame[1] == ref_frame) | 67 else if (candidate->ref_frame[1] == ref_frame) |
| 68 ADD_MV_REF_LIST(candidate->mv[1], refmv_count, mv_ref_list, Done); | 68 ADD_MV_REF_LIST(candidate->mv[1], refmv_count, mv_ref_list, Done); |
| 69 } | 69 } |
| 70 } | 70 } |
| 71 | 71 |
| 72 // Synchronize here for frame parallel decode if sync function is provided. | 72 // TODO(hkuang): Remove this sync after fixing pthread_cond_broadcast |
| 73 if (sync != NULL) { | 73 // on windows platform. The sync here is unncessary if use_perv_frame_mvs |
| 74 sync(data, mi_row); | 74 // is 0. But after removing it, there will be hang in the unit test on windows |
| 75 } | 75 // due to several threads waiting for a thread's signal. |
| 76 #if defined(_WIN32) && !HAVE_PTHREAD_H |
| 77 if (cm->frame_parallel_decode && sync != NULL) { |
| 78 sync(data, mi_row); |
| 79 } |
| 80 #endif |
| 76 | 81 |
| 77 // Check the last frame's mode and mv info. | 82 // Check the last frame's mode and mv info. |
| 78 if (cm->use_prev_frame_mvs) { | 83 if (cm->use_prev_frame_mvs) { |
| 84 // Synchronize here for frame parallel decode if sync function is provided. |
| 85 if (cm->frame_parallel_decode && sync != NULL) { |
| 86 sync(data, mi_row); |
| 87 } |
| 88 |
| 79 if (prev_frame_mvs->ref_frame[0] == ref_frame) { | 89 if (prev_frame_mvs->ref_frame[0] == ref_frame) { |
| 80 ADD_MV_REF_LIST(prev_frame_mvs->mv[0], refmv_count, mv_ref_list, Done); | 90 ADD_MV_REF_LIST(prev_frame_mvs->mv[0], refmv_count, mv_ref_list, Done); |
| 81 } else if (prev_frame_mvs->ref_frame[1] == ref_frame) { | 91 } else if (prev_frame_mvs->ref_frame[1] == ref_frame) { |
| 82 ADD_MV_REF_LIST(prev_frame_mvs->mv[1], refmv_count, mv_ref_list, Done); | 92 ADD_MV_REF_LIST(prev_frame_mvs->mv[1], refmv_count, mv_ref_list, Done); |
| 83 } | 93 } |
| 84 } | 94 } |
| 85 | 95 |
| 86 // Since we couldn't find 2 mvs from the same reference frame | 96 // Since we couldn't find 2 mvs from the same reference frame |
| 87 // go back through the neighbors and find motion vectors from | 97 // go back through the neighbors and find motion vectors from |
| 88 // different reference frames. | 98 // different reference frames. |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 if (nearest_mv->as_int != candidates[n].as_int) { | 219 if (nearest_mv->as_int != candidates[n].as_int) { |
| 210 near_mv->as_int = candidates[n].as_int; | 220 near_mv->as_int = candidates[n].as_int; |
| 211 break; | 221 break; |
| 212 } | 222 } |
| 213 break; | 223 break; |
| 214 } | 224 } |
| 215 default: | 225 default: |
| 216 assert("Invalid block index."); | 226 assert("Invalid block index."); |
| 217 } | 227 } |
| 218 } | 228 } |
| OLD | NEW |